Re:Kweb: A new approach to building rich webapps, in Kotlin
by Matthias247 on Sunday December 09, 2018 @06:06PM
(#18643898)
The first seems to add new DOM nodes with text on every click. The second one doesn't. So they don't seem to be equivalent.
[ Parent
| on HN ]
Re:Kweb: A new approach to building rich webapps, in Kotlin
by renegadus on Sunday December 09, 2018 @07:00PM
(#18644159)
Hmm, it seems to be adding things to a list but where is it adding a new DOM node?
Re:Kweb: A new approach to building rich webapps, in Kotlin
by Matthias247 on Sunday December 09, 2018 @07:12PM
(#18644214)
I would say in
for x in lines:
tdiv:
text x
Whenever the DOM gets rerendered, it iterates over the the lines (or the "model" in general), and creates DOM elements from it. At least it looks very similar to React and Angular code, and they do exactly this.