Created
November 28, 2022 09:22
-
-
Save mfaridzia/0d8a8418a9eea21dfc8734f9617de578 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 trafficLightMachine = Machine({ | |
id: "trafficLight", | |
initial: "green", | |
states: { | |
green: { | |
on: { TO_YELLOW: "yellow" } | |
}, | |
yellow: { | |
on: { TO_RED: "red" } | |
}, | |
red: { | |
on: { TO_GREEN: "green" } | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment