Skip to content

Instantly share code, notes, and snippets.

@tgrecojs
Created December 20, 2019 03:24
Show Gist options
  • Select an option

  • Save tgrecojs/59e91956a66f516adb90e8eb9e361633 to your computer and use it in GitHub Desktop.

Select an option

Save tgrecojs/59e91956a66f516adb90e8eb9e361633 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: 'lightswitch',
initial: 'off',
states : {
turned_off: {
on: {
BREAK: 'off',
toggle: 'on'
},
},
turned_on: {
on: {
BREAK: 'off',
toggle: 'off'
},
}
}
})
const fetchMachineTwo = Machine({
id: 'lightswitch',
initial: 'off',
states : {
turned_off: {
on: {
BREAK: 'off',
toggle: 'on'
},
},
turned_on: {
on: {
BREAK: 'off',
toggle: 'off'
},
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment