Ouch, welcome to callback hell :(
Futures would be slightly better. The least painful approach to things like that. to my mind, is an explicit event loop, and posting events on a change.
FWIW Eventing systems are not the same as callback hell. "Tell me when this variable changes" is the heart of a lot of really well engineered systems, including high performance hardware IO. (Fill this buffer w/o bothering the CPU, when the buffer is full, call this function to process its contents).
Eventing systems are nice.
> The least painful approach to things like that. to my mind, is an explicit event loop, and posting events on a change.
That is how Windows works under the covers.
Events are just syntactic sugar on top if that, in replacement of a giant switch/case statement.
[1]https://meanderingthoughts.hashnode.dev/cooperative-multitas...
What I really want is a trivial way to say "fire this callback whenever this variable changes."
Mobx actually enables this w/o too much work, and Svelte stores are a really nice syntaxical wrapper around the concept.
Heck just give me what C# had back in 2002 and I'd be happy.