Skip to content

Instantly share code, notes, and snippets.

@kyleshevlin
Created November 20, 2019 03:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyleshevlin/f6ed39c1c2d92922aee6937148b82b3f to your computer and use it in GitHub Desktop.
Save kyleshevlin/f6ed39c1c2d92922aee6937148b82b3f to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const lightBulbMachine = Machine({
id: 'lightBulb',
initial: 'unlit',
states: {
unlit: {
on: {
BREAK: 'broken',
TOGGLE: 'lit'
}
},
lit: {
on: {
BREAK: 'broken',
TOGGLE: 'unlit'
}
},
broken: {
type: 'final'
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment