Created
July 22, 2021 08:08
-
-
Save bfunc/66260f1cc7d6240fee6f15559a0fcfb2 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
// The Door - state machine | |
const fetchMachine = Machine({ | |
id: 'TheDoor', | |
initial: 'locked', | |
context: {}, | |
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