Xstate: State machines and statecharts for the modern web
1–10 of 81 posts
Re: Xstate: State machines and statecharts for the modern web
#2Re: Xstate: State machines and statecharts for the modern web
#3https://gist.github.com/andymatuschak/d5f0a8730ad601bcccae97...
It doesn't require a library, it binds states and effects together, it is completely pure, and it can be implemented in most any language, preferably one with sum types and exhaustiveness checking. It works equally well with both complex, time-dependent business logic as well as code that controls UI states.
I love state machines for help in writing robust code. The act of laying them out this way forces you to consider lots of intermediate states that are ignore or forget. Plus, the logic stays away from all the gunk of the platform, state machines are trivial to test, and, once you get used to them, are easy to read.
Re: Xstate: State machines and statecharts for the modern web
#4love how xstate makes implicit state machines explicit with a time tested (one might say Lindy) format. badly/ad hoc defined state machines are the source of so many bugs - David has been banging this particular drum the entire time i've known him ( https://www.youtube.com/watch?v=HPoC-k7Rxwo&list=PLRvKvw42Rc... )
–a former colleague
Re: Xstate: State machines and statecharts for the modern web
#5love how xstate makes implicit state machines explicit with a time tested (one might say Lindy) format. badly/ad hoc defined state machines are the source of so many bugs - David has been banging this particular drum the entire time i've known him ( https://www.youtube.com/watch?v=HPoC-k7Rxwo&list=PLRvKvw42Rc... )
Re: Xstate: State machines and statecharts for the modern web
#6I need to write a post on this, but I've been using this pattern to great effect: https://gist.github.com/andymatuschak/d5f0a8730ad601bcccae97... It doesn't require a library, it binds states and effects together, it is completely pure, and it can be implemented in most any language, preferably one with sum types and exhaustiveness checking. It works equally well with both complex, time-dependent business logic as we…
Re: Xstate: State machines and statecharts for the modern web
#7love how xstate makes implicit state machines explicit with a time tested (one might say Lindy) format. badly/ad hoc defined state machines are the source of so many bugs - David has been banging this particular drum the entire time i've known him ( https://www.youtube.com/watch?v=HPoC-k7Rxwo&list=PLRvKvw42Rc... )
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.
Re: Xstate: State machines and statecharts for the modern web
#8Fair 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
#9The entire kiosk device could be repurposed on the fly and Xstate + JSON schema form allowed for completely customizable & swappable UI.
Shame the project died.
Re: Xstate: State machines and statecharts for the modern web
#10The 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?