Skip to content

Instantly share code, notes, and snippets.

@lozandier
Created January 15, 2020 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lozandier/a7ce33c9c728adfb43e5ef61c7eaad1d to your computer and use it in GitHub Desktop.
Save lozandier/a7ce33c9c728adfb43e5ef61c7eaad1d to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = 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