Skip to content

Instantly share code, notes, and snippets.

@tomByrer
Last active October 19, 2020 19:27
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 tomByrer/3be1fe0cd3fe574e4913551ed5f6f027 to your computer and use it in GitHub Desktop.
Save tomByrer/3be1fe0cd3fe574e4913551ed5f6f027 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// orig: https://xstate.js.org/viz/?gist=41fb3365af80efff10afb782e9cf9e61
const powerstrip = Machine({
id: 'powerstrip',
initial: 'powerstripOff',
states: {
powerstripOff: {
id: 'basementPowerstriphOff',
on: {
SWITCH_ON: 'poweredOn'
}
},
poweredOn: {
initial: 'notRunning',
states: {
notRunning: {
on: {
FOOTPEDAL_DOWN: 'running'
}
},
running: {
on: {
FOOTPEDAL_RELEASE: 'notRunning'
}
},
},
on: {
SWITCH_OFF: '#basementPowerstriphOff',
},
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment