Created
April 12, 2021 11:02
-
-
Save yosevu/9742d43d57d9ece135f9247abb5a6842 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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: { | |
lit: { | |
on: { | |
BREAK: 'broken', | |
TOGGLE: 'unlit', | |
}, | |
}, | |
unlit: { | |
on: { | |
BREAK: 'broken', | |
TOGGLE: 'lit', | |
}, | |
}, | |
broken: { type: 'final' }, | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment