https://github.com/theremotecoder/state-machines-playground
State machines with XState
https://github.com/theremotecoder/state-machines-playground
drag-and-drop draggable ecmascript ecmascript6 es6 html html5 javascript javascript-es6 js node state state-machine state-management statemachine statemachine-library statemachines statemanagement xstate xstate-test
Last synced: 4 months ago
JSON representation
State machines with XState
- Host: GitHub
- URL: https://github.com/theremotecoder/state-machines-playground
- Owner: TheRemoteCoder
- Created: 2021-03-12T09:12:31.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-30T19:15:29.000Z (over 3 years ago)
- Last Synced: 2025-01-09T21:35:44.455Z (6 months ago)
- Topics: drag-and-drop, draggable, ecmascript, ecmascript6, es6, html, html5, javascript, javascript-es6, js, node, state, state-machine, state-management, statemachine, statemachine-library, statemachines, statemanagement, xstate, xstate-test
- Language: JavaScript
- Homepage:
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# State machines
- [About](#about)
- [Use](#use)
- [Technologies](#technologies)
- [Knowledge](#knowledge)
- [Sources](#sources)---
## About
Comparison of Robot and XState for basic concepts and API features.
The basic test scenario for both is a state machine imaginable for a Sci-Fi game,
where players have a space ship which can activate a shield (limited times).Besides that, some arbitrary advanced concepts are tested and experimented on.
---
## Use
- Run via Browser -or- NPM (see script commands)
---
## Technologies
- Robot: https://thisrobot.life
- XState: https://xstate.js.org---
## Knowledge
### Robot
- Order of functions in transitions matter, e.g. with a guard in the first,
if this fails the second will be called (for the same command)
- Nested machines with a single service seem hard to debug/test
- There is probably a better way ...?### XState
- Nested machine states can propagate to parents, if unhandled by the current state
---
## Sources
- https://xstate.js.org/docs/guides/introduction-to-state-machines-and-statecharts