Skip to content

Instantly share code, notes, and snippets.

@ruff3d
Last active June 17, 2021 11:29
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 ruff3d/78d1e8722f187305ef3e5eab5dc7f079 to your computer and use it in GitHub Desktop.
Save ruff3d/78d1e8722f187305ef3e5eab5dc7f079 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: 'booking-state',
initial: 'new',
states: {
new: {
on: { 'Reserved': 'Reserved' },
},
'Reserved': {
on: {
'Booked': 'Booked',
'Offline': 'Offline',
'Deleted': 'Deleted',
},
},
'Booked': {
on: {
'Processing': 'Processing',
'Rejected': 'Rejected',
},
},
'Processing': {
on: { 'Approved': 'Approved' },
},
'Approved': {
on: { 'Sent': 'Sent' },
},
'Sent': {
on: { 'Canceled': 'Canceled' },
},
'Offline': {
on: { 'Done': 'Done' },
},
'Deleted': {
on: { 'Done': 'Done' },
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment