Skip to content

Instantly share code, notes, and snippets.

@datdoan
Created September 7, 2020 00:54
Show Gist options
  • Save datdoan/1b7e547726310d996a72c748ad00eaf2 to your computer and use it in GitHub Desktop.
Save datdoan/1b7e547726310d996a72c748ad00eaf2 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 statusMachine = Machine({
id: 'status',
type: 'parallel',
states: {
closed: {
initial: 'on',
states: {
on: {
on: { TOGGLE_CLOSED: 'off' }
},
off: {
on: { TOGGLE_CLOSED: 'on' }
}
}
},
open: {
initial: 'on',
states: {
on: {
on: { TOGGLE_OPEN: 'off' }
},
off: {
on: { TOGGLE_OPEN: 'on' }
}
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment