Is 5% a reasonable cut for a middle-man when selling shares privately?
6 pointsby renegadus13 comments
button.on.click {
header.text("They clicked!")
}
This is less efficient than it could be because it is needlessly doing a server round-trip. So for situations where you're only modifying client state you can do: button.onImmediate.click {
header.text("They clicked!")
}
When the user clicks it will be instant, as the instructions to modify the DOM are "preloaded" to the client on page render. var lines: seq[kstring] = @[]
proc createDom(): VNode =
result = buildHtml(tdiv):
button:
text "Say hello!"
proc onclick(ev: Event; n: VNode) =
lines.add "Hello simulated universe"
for x in lines:
tdiv:
text x
setRenderer createDom
Here is the equivalent in Kweb: fun main() {
Kweb(port = 2734) {
doc.body.new {
button().text("Say hello!").on.click {
println("Hello simulated universe")
}
}
}
}
This compiles and works.