Last active
November 2, 2021 13:56
-
-
Save jasondavis/640e5a9505b9d0b2e210b01dca75f979 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const fetchMachine = Machine({ | |
"initial": "Off", | |
"states": { | |
"Off": { | |
"on": { | |
"FLICK": "On" | |
}, | |
"initial": "A", | |
"states": { | |
"A": { | |
"on": { | |
"FLICK": "A", | |
"UNBLOCK": "B" | |
}, | |
"onEntry": { | |
"type": "startUnblockTimer", | |
"delay": 2000 | |
}, | |
"onExit": { | |
"type": "cancelUnblockTimer" | |
} | |
}, | |
"B": {} | |
} | |
}, | |
"On": { | |
"on": { | |
"FLICK": "Off" | |
}, | |
"initial": "C", | |
"states": { | |
"C": { | |
"on": { | |
"UNBLOCK": "D" | |
}, | |
"onEntry": { | |
"type": "startUnblockTimer", | |
"delay": 500 | |
}, | |
"onExit": { | |
"type": "cancelUnblockTimer" | |
} | |
}, | |
"D": { | |
"onEntry": { | |
"type": "turnOn" | |
}, | |
"onExit": { | |
"type": "turnOff" | |
}, | |
"initial": "E", | |
"states": { | |
"E": { | |
"on": { | |
"UNBLOCK": "F" | |
}, | |
"onEntry": { | |
"type": "startUnblockTimer", | |
"delay": 500 | |
}, | |
"onExit": { | |
"type": "cancelUnblockTimer" | |
}, | |
"initial": "G", | |
"states": { | |
"G": { | |
"on": { | |
"FLICK": "G" | |
} | |
} | |
} | |
}, | |
"F": {} | |
} | |
} | |
} | |
} | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment