Fun read. Curious: you say that the scheduling logic should not be used in practice. In that case, what should be used instead? Do you know if anyone has done a write up on scheduling for signals?
Thanks! I just meant that I don’t batch or queue micro tasks for effects. I’m away from my computer but I think svelte and preact signals have really well documented effects!
Yeah I was just curious if that's the naive/basic approach, what's a more complete approach. Thanks I'll see if I can find something. Come to think of it, I'm sure Ryan Carniato must have done a write up somewhere
I’ve followed signals in some of the frameworks. However I must be living under a rock because I somehow missed that there was a TC39 proposal. This was great!
Comments
If you want I also have a talk on the argument https://ricciuti.me/speaking#surprise-svelte-secretly-sending-signals
(You can find the link to the video there and I'll be doing that talk again at FrontendNation (in 4 days) and at JSNation the 12 of June
Microtask scheduling is often good enough (except when you have other invariants to keep). See utilities here: https://github.com/proposal-signals/signal-utils
I think the DOM should have a built-in scheduler suitable for component updates: https://github.com/WICG/webcomponents/issues/1055