Skip to content

Instantly share code, notes, and snippets.

@theverything
Last active January 23, 2020 19:36
Show Gist options
  • Save theverything/e182af268b3081727879acf7cc3dcd03 to your computer and use it in GitHub Desktop.
Save theverything/e182af268b3081727879acf7cc3dcd03 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const task = Machine({
id: 'task',
initial: 'loading',
states: {
loading: {
on: {
ERROR: 'error',
AVAILABLE: 'available',
},
},
available: {
on: {
UNAVAILABLE: 'unavailable',
RESERVATION_CREATE: 'reservationCreated',
RESERVATION_ACCEPT: 'reservationAccepted',
},
},
unavailable: {
on: {
AVAILABLE: 'available',
},
},
error: {
on: {
UNAVAILABLE: 'unavailable',
},
},
reservationCreated: {
on: {
RESERVATION_ACCEPT: 'reservationAccepted',
ERROR: 'error',
UNAVAILABLE: 'unavailable',
},
},
reservationAccepted: {
on: {
ERROR: 'error',
AVAILABLE: 'available',
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment