Skip to content

Instantly share code, notes, and snippets.

@mwagz
Created October 29, 2021 19:27
Show Gist options
  • Save mwagz/116f9c620ef24e6caeca1994e3de5461 to your computer and use it in GitHub Desktop.
Save mwagz/116f9c620ef24e6caeca1994e3de5461 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: 'contain',
initial: 'determine',
states: {
determine: {
entry: () => {},
},
standard: {
on: {
CLICK: 'containing',
},
},
containing: {
entry: () => {},
on: {
CONTAIN: () => {},
CANCEL: () => {},
},
},
pending: {
on: {
CLICK: 'change',
},
},
change: {
entry: () => {},
on: {
KEEP_TRYING: () => {},
STOP_TRYING: () => {},
CANCEL: () => {},
},
},
liftPending: {
on: {
CLICK: 'lift',
},
},
lift: {
entry: () => {},
on: {
LEAVE_CONTAINED: () => {},
KEEP_TRYING: () => {},
},
},
contained: {
on: {
CLICK: 'restore',
},
},
restore: {
entry: () => {},
on: {
STOP: () => {},
CANCEL: () => {},
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment