News for hackers. Stuff that matters.
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.
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.
Re:Kweb: A new approach to building rich webapps, in Kotlin by renegadus on Sunday December 09, 2018 @07:51PM (#18644361)
Ah, you're right. Ok, I think I can do that fairly concisely in Kweb also, if I find a bit of time.