Last active
May 15, 2020 14:50
-
-
Save Catsync/4d7bcaa42bb834dd51efaf7109c1966a 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 door = Machine({ | |
id: 'door', | |
initial: 'locked', | |
states: { | |
locked: { | |
id: 'locked', | |
on: { UNLOCK: 'unlocked' } | |
}, | |
unlocked: { | |
initial: 'closed', | |
states: { | |
closed: { | |
on: { | |
LOCK: '#locked', | |
OPEN: 'opened' | |
} | |
}, | |
opened: { | |
on: { CLOSE: 'closed' } | |
} | |
} | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment