Skip to content

Instantly share code, notes, and snippets.

@AndreAffonso
Last active May 9, 2022 13:05
Show Gist options
  • Save AndreAffonso/5fab322f311aefe5d399385fabb4439a to your computer and use it in GitHub Desktop.
Save AndreAffonso/5fab322f311aefe5d399385fabb4439a 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)
//PLANS STATE MACHINE
const fetchMachine = Machine({
id: 'fetch',
initial: 'draft',
states: {
draft: {
on: {
PUBLISH: 'active',
COPY: 'draft'
}
},
active: {
on: {
ARCHIVE: 'archived',
}
},
archived: {
on: {
COPY: 'draft',
},
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment