3 ms·
A great use case (as mentioned in the article) is complex UI state. I've used this library very succesfully in such a situation: https://github.com/kenkunz/sve
by pragmatic 4y ago
A great use case (as mentioned in the article) is complex UI state.
I've used this library very succesfully in such a situation:
https://github.com/kenkunz/svelte-fsm https://github.com/kenkunz/svelte-fsm
Svelte + FSM turned one of the most convoluted UXes I've every dealt with into something manageable and almost pleasant.
This is a complex sales kiosk that must operate work limited or flapping network connectivity entire handling huge spikes in usage.
Svelte itself jusy gets out of the way, you don't fight it. The FSM makes your mental model explicit.
Something like "ok, we're halfway through the complex terminal registration process, the last network request timed out and the user pressed the back button, we have half the necessary data cached in indexeddb, now what?"
With boolean flags its a mess.
- pragmatic 4y agoOn this scenerio each page has a starter machine and some components might as well. So you can in fact nest state machines. Totally undeused concept I've been trying to implement since the VB6 days.