Skip to content

Instantly share code, notes, and snippets.

@CheezItMan
Created May 11, 2020 03:34
Show Gist options
  • Select an option

  • Save CheezItMan/893569c0fb3869ee45b28329d16991c9 to your computer and use it in GitHub Desktop.

Select an option

Save CheezItMan/893569c0fb3869ee45b28329d16991c9 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = Machine({
id: 'lightToggle',
initial: 'red',
states: {
red: {
on: {
changeLight: 'green',
},
},
green: {
on: {
changeLight: 'yellow',
},
},
yellow: {
on: {
changeLight: 'red',
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment