Skip to content

Instantly share code, notes, and snippets.

@tivac
Last active May 27, 2021 19:52
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 tivac/d5918a29c452a4da95a7fc54f7c5b267 to your computer and use it in GitHub Desktop.
Save tivac/d5918a29c452a4da95a7fc54f7c5b267 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: 'fetch',
initial: 'parallel',
context: {
retries: 0
},
states: {
parallel: {
type: 'parallel',
states: {
one: {
initial: 'child',
states: {
child: {
on: {
'ONE_NEXT': 'next',
}
},
next: {
type: 'final',
},
},
},
two: {
initial: 'child',
states: {
child: {
on: {
'TWO_NEXT': 'next',
}
},
next: {
type: 'final',
},
},
},
},
onDone: 'done',
},
done: {}
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment