Created
November 20, 2019 03:07
-
-
Save kyleshevlin/f6ed39c1c2d92922aee6937148b82b3f to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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