The readme gives the example of a traffic light to demo a state machine usecase. Fair enough, but what's a rudimentary usecase for 'the modern web'? What everyday UI thing is better done with this than other methods? Why is it better?
The ubiquitous waiting/loading/error(msg)/success(data) Lots of frameworks and state management libraries already lean towards helpful design, in languages with async and ADTs as first-class citizens you've got a real leg up, but at the end of the day it comes down to preventing impossible states. You can't have an error message when in the success state, you can't have success data while loading or waiting. By preve…
Xstate: State machines and statecharts for the modern web
21–30 of 81 posts
Re: Xstate: State machines and statecharts for the modern web
#22Earlier quoted context omitted.
I wonder if we could build better implicit state machines if we could more easily visualize our imperative code by annotating it with visualization hints and parsing the AST. Also easier to debug/step-through this way.
Then why not just make it explicit?
Re: Xstate: State machines and statecharts for the modern web
#23Re: Xstate: State machines and statecharts for the modern web
#24Re: Xstate: State machines and statecharts for the modern web
#25Earlier quoted context omitted.
Sounds awesome, given it died could you publish the source? Would be great to see how something like this is structured.
Unfortunately no. It was proprietary. (we pushed to open source the guts, but to no avail) Both of us reminisce about it though. We literally retooled the fleet of devices in a weekend to adapt to COVID and it worked. We interfaced with tons of hardware and even ran a customized debian image, all powered by RPis. Truly a nerd's dream project.
Re: Xstate: State machines and statecharts for the modern web
#26Earlier quoted context omitted.
Unfortunately no. It was proprietary. (we pushed to open source the guts, but to no avail) Both of us reminisce about it though. We literally retooled the fleet of devices in a weekend to adapt to COVID and it worked. We interfaced with tons of hardware and even ran a customized debian image, all powered by RPis. Truly a nerd's dream project.
We're currently building something that sounds superficially similar, would you be interested in having a chat?
Re: Xstate: State machines and statecharts for the modern web
#27The readme gives the example of a traffic light to demo a state machine usecase. Fair enough, but what's a rudimentary usecase for 'the modern web'? What everyday UI thing is better done with this than other methods? Why is it better?
Re: Xstate: State machines and statecharts for the modern web
#28I've seen XState more and more, recently, what are the pros and cons versus other state management solutions? Anything that XState fails at particularly that potential users should be aware of?
Learning curve is more similar to rx-js or fp-ts than a state manager.
Re: Xstate: State machines and statecharts for the modern web
#29I've seen XState more and more, recently, what are the pros and cons versus other state management solutions? Anything that XState fails at particularly that potential users should be aware of?
Re: Xstate: State machines and statecharts for the modern web
#30The readme gives the example of a traffic light to demo a state machine usecase. Fair enough, but what's a rudimentary usecase for 'the modern web'? What everyday UI thing is better done with this than other methods? Why is it better?
The ubiquitous waiting/loading/error(msg)/success(data) Lots of frameworks and state management libraries already lean towards helpful design, in languages with async and ADTs as first-class citizens you've got a real leg up, but at the end of the day it comes down to preventing impossible states. You can't have an error message when in the success state, you can't have success data while loading or waiting. By preve…
A state machine is the wrong solution unless you also need to restrict transitions themselves in my opinion