Skip to content

Instantly share code, notes, and snippets.

@jasonleonhard
Created April 3, 2020 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonleonhard/9212a9a764292e80cdcbcfda3feb66bf to your computer and use it in GitHub Desktop.
Save jasonleonhard/9212a9a764292e80cdcbcfda3feb66bf to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const lifeMachine = Machine({
id: 'life',
initial: 'alive',
context: {
retries: 0
},
states: {
alive: {
on: {
KILL: 'dying'
}
},
dying: {
on: {
RESUSCITATE: 'alive',
PRONOUNCE: 'dead'
}
},
dead: {
type: 'final'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment