Build a Cart Powered by State Machines
State machines help us visualize complex UI logic and make our components much more predictable and error resistant. In this episode, Jason creates a state machine using xstate to manage the opening and closing of an animated cart component.
Resources & Links
- Demo
- Repo
- xstate.js.org/viz/?gist=12a349643a70a8b09c7f7841b5168284
- xstate.js.org/docs/packages/xstate-react/
- en.wikipedia.org/wiki/Finite-state_machine
- codepen.io/jlengstorf/pen/oNXpeqd
- gedd.ski/post/state-machines-in-react/
- reactjs.org/docs/forwarding-refs.html
- developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translate
- shop.coavacoffee.com/
- partycorgi.com/