Created
August 6, 2020 04:23
-
-
Save afbroman/c44cacefb9eab148b99ad9e26779d27d 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
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