Skip to content

Instantly share code, notes, and snippets.

@mattpocock
Created July 28, 2020 08:19
Show Gist options
  • Save mattpocock/cf1578f5baa04cf9408ef6e48695f04c to your computer and use it in GitHub Desktop.
Save mattpocock/cf1578f5baa04cf9408ef6e48695f04c 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: 'modalMachine',
initial: 'closed',
states: {
closed: {
on: {
OPEN: {
target: 'open',
},
TOGGLE: 'open',
},
},
open: {
on: {
TOGGLE: 'closed',
CLOSE: 'closed',
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment