by divbzero · 2y ago · 0 comments
And the difference between duplicated and mirrored is ...
Mirrored means when you update state, your changes are reflected in the DOM, automagically.
Duplicated means when you change state, you also have to make the changes to the DOM, yourself.
It appears that Puter handles templating with a pattern like:
let h = ``
h += `<div>${exampleContent}</div>`
h += `<div>${moreExampleContent}</div>`
$(targetEl).append(h)
And handles events in the traditional way: $(targetEl).on('click', function () { /* do stuff */ });
Searching for “React” or “jQuery” in this thread, there are several other conversations with thoughtful comments about pros and cons. One curious tidbit that I learned is that Visual Studio Code doesn’t use a framework either and, like Puter, updates the DOM directly.