Skip to content

Instantly share code, notes, and snippets.

@ronaiza-cardoso
Created May 21, 2020 10:19
Show Gist options
  • Save ronaiza-cardoso/741c93c332007946087db6372c87f86a to your computer and use it in GitHub Desktop.
Save ronaiza-cardoso/741c93c332007946087db6372c87f86a to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'door',
initial: 'locked',
states: {
locked: {
id: 'locked',
on: {
UNLOCKED: 'unlocked'
}
},
unlocked: {
initial: 'closed',
states: {
opened: {
on: {
OPEN: 'closed'
}
},
closed: {
on: {
LOCK: '#locked',
CLOSE: 'opened'
}
}
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment