Skip to content

Instantly share code, notes, and snippets.

@wlepinski
Created February 22, 2023 19:41
Show Gist options
  • Save wlepinski/27c4829187084fac0442cc3025d86c8a to your computer and use it in GitHub Desktop.
Save wlepinski/27c4829187084fac0442cc3025d86c8a 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: 'workflow',
initial: 'draft',
context: {
retries: 0
},
states: {
draft: {
on: {
IMPLEMENT: 'implement'
}
},
implement: {
on: {
RUN: 'running'
}
},
running: {
on: {
PAUSE: 'paused',
STOP: 'analysis'
}
},
paused: {
on: {
RESUME: 'running'
}
},
analysis: {
on: {
COMPLETE: 'completed'
}
},
completed: {
final: true
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment