Created
June 5, 2021 13:09
-
-
Save jinnkhan88/1a1e55332857bad3815f423a58e5a9ca 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 doorMachine = Machine({ | |
id:'door', | |
initial:'locked', | |
states:{ | |
locked:{ | |
id:'locked', | |
on:{ | |
unlocked:'unlocked' | |
} | |
}, | |
unlocked:{ | |
initial:'closed', | |
states:{ | |
closed:{ | |
on:{ | |
LOCKED:'#locked', | |
OPEN:'open' | |
} | |
}, | |
open:{ | |
on:{ | |
CLOSED:'closed' | |
} | |
} | |
} | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment