Skip to content

Instantly share code, notes, and snippets.

@mtheoryx
Created June 1, 2020 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtheoryx/d781bcb5ae93964c65b3d43b67a18b6b to your computer and use it in GitHub Desktop.
Save mtheoryx/d781bcb5ae93964c65b3d43b67a18b6b to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const lightBulbMachine = Machine({
id: "lightBulb",
initial: "unlit",
states: {
lit: {
on: {
BREAK: "broken",
TOGGLE: "unlit",
},
},
unlit: {
on: {
BREAK: "broken",
TOGGLE: "lit",
},
},
broken: { type: "final" },
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment