Skip to content

Instantly share code, notes, and snippets.

@parties
Last active March 10, 2021 05:40
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 parties/fa5b0c4c65bf31443757e816bd82f29a to your computer and use it in GitHub Desktop.
Save parties/fa5b0c4c65bf31443757e816bd82f29a 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 toggle = Machine({
id: 'toggle',
initial: 'all',
context: {
retries: 0
},
states: {
onlyActive: {
on: {
CLICK_ACTIVE: 'all',
CLICK_PLANNED: 'onlyPlanned'
}
},
onlyPlanned: {
on: {
CLICK_ACTIVE: 'onlyActive',
CLICK_PLANNED: 'all'
}
},
all: {
on: {
CLICK_ACTIVE: 'onlyActive',
CLICK_PLANNED: 'onlyPlanned',
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment