Re:Show HN: CalDOM: An agnostic, reactive and minimalist Jav...
by dumindaxsb on Monday July 19, 2021 @09:40PM
(#27889265)
Exactly, and state changes are batched behind requestAnimationFrame :)
Also, there's .react(new_state), which is synchronous.
If one prefer not to use Proxies (old browsers, etc), it can be disabled via .react( state, { ..., watched: false } ) and then can call just .react() manually after state changes. Which is also batched(async).
Re:Show HN: CalDOM: An agnostic, reactive and minimalist Jav...
by seph-reed on Wednesday July 21, 2021 @12:00PM
(#27907994)
Woah. Congrats. This is pretty much exactly the setup I've been using for a few years now. It is -- without a doubt -- vastly better than any other frameworks approach I've ever used.
Re:Show HN: CalDOM: An agnostic, reactive and minimalist Jav...
by dumindaxsb on Monday July 19, 2021 @09:48PM
(#27889304)
Same technique is used for .$ reference holder. Proxies are awesome! :)
I'm assuming state is a proxy and you're using the single threaded nature of JS to make render functions dependent on accessed variables?