Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kyleshevlin
Created November 27, 2019 00:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kyleshevlin/18233c3bf2bac4e48f4fdfaf516f0e0a to your computer and use it in GitHub Desktop.
Save kyleshevlin/18233c3bf2bac4e48f4fdfaf516f0e0a to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const toastMachine = Machine({
id: 'toast',
initial: 'poweredOff',
states: {
poweredOff: {
on: { POWER_ON: 'poweredOn.hist' }
},
poweredOn: {
on: { POWER_OFF: 'poweredOff' },
type: 'parallel',
states: {
hist: {
type: 'history',
history: 'deep'
},
heatLevel: {
initial: 'light',
states: {
light: {
on: { HOTTER: 'medium' }
},
medium: {
on: {
COOLER: 'light',
HOTTER: 'high'
}
},
high: {
on: { COOLER: 'medium' }
}
}
},
duration: {
initial: 'short',
states: {
short: {
on: { LONGER: 'long' }
},
long: {
on: { SHORTER: 'short' }
}
}
},
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment