4 ms·
The way they show off observables here is solves a lot of problems, but despite offering up Svelte as an example of observables, it doesn't seem to aim to solve
by com2kid 3y ago
The way they show off observables here is solves a lot of problems, but despite offering up Svelte as an example of observables, it doesn't seem to aim to solve the problem that Svelte stores do.
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.
- nine_k 3y ago> fire this callback whenever this variable changes 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.
- com2kid 3y agoBeen there, helped design an entire embedded runtime based[1] around it, didn't mind it. 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-multitasking-on-microsoft-band https://meanderingthoughts.hashnode.dev/cooperative-multitas...