Skip to content

Instantly share code, notes, and snippets.

@rajinder-yadav
Created July 3, 2020 10:00
Show Gist options
  • Save rajinder-yadav/4febc9c495f81816efba46579477e9f1 to your computer and use it in GitHub Desktop.
Save rajinder-yadav/4febc9c495f81816efba46579477e9f1 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 lightSwitchMachine = Machine({
id: 'light-switch',
initial: 'light-off',
states: {
'light-off': {
on: {
'SWITCH.UP': 'light-on'
}
},
'light-on': {
on: {
'SWITCH.DOWN': 'light-off'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment