Created
November 27, 2019 00:17
-
-
Save kyleshevlin/18233c3bf2bac4e48f4fdfaf516f0e0a to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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