Created
August 3, 2020 23:34
-
-
Save afbroman/bd4ce28f70f150a97590c7fac4888e50 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
const displayMachine = Machine( | |
{ | |
initial: "hidden", | |
states: { | |
hidden: { | |
on: { | |
TURN_ON: "visible", | |
}, | |
}, | |
visible: { | |
type: "parallel", | |
on: { | |
TURN_OFF: "hidden", | |
}, | |
states: { | |
mode: { | |
initial: "light", | |
states: { | |
light: { | |
on: { | |
SWITCH: "dark", | |
}, | |
}, | |
dark: { | |
on: { | |
SWITCH: "light", | |
}, | |
}, | |
}, | |
}, | |
brightness: { | |
initial: "bright", | |
states: { | |
bright: { | |
after: { | |
TIMEOUT: "dim", | |
}, | |
}, | |
dim: { | |
on: { | |
SWITCH: "bright", | |
}, | |
}, | |
}, | |
}, | |
}, | |
}, | |
}, | |
}, | |
{ | |
delays: { | |
TIMEOUT: 5000, | |
}, | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment