very little coding happens here.
PR process fsm graph
State Machine
State Machine
Statechart
Statechart
1970's Citizen watch
usefulness -->
number of states -->
https://www.desmos.com/calculator/fywfdcsqxr
FSM
usefulness -->
number of states -->
https://www.desmos.com/calculator/fywfdcsqxr
composite states
FSM
usefulness -->
number of states -->
https://www.desmos.com/calculator/fywfdcsqxr
FSM
parallel states
history states
composite states
guards
usefulness -->
number of states -->
https://www.desmos.com/calculator/fywfdcsqxr
FSM
parallel states
history states
composite states
guards
{
initial: 'idle',
states: {
idle: { on: {SUBMIT: 'loading' } },
loading: { on: {PF: 'error' ,
PR: 'success' } },
success: { },
error: { on: { SUBMIT: 'loading' } }
}
}
Redux gives us a clean way to separate state from our UI and that helps manage changing state, but what state changes to is 'coded' in a (perhaps too powerful) function.
-- colleague of R. Braithwaite
-- colleague of R. Braithwaite
$ npx create-react-app some-xstate-app
$ cd some-xstate-app
$ npm install xstate --save
... create a state machine ...
. . . Make some UI components . . .
$ npm start
... watch your state machine run ...
OR git clone https://github.com/nmorse/amendments.git
specifications are shared in a common language (a visual representation)
predictable state mutations (transitions are traceable)
easy to reason about because it is less expressive
you can't cheat
Further topics: