Skip to content

Instantly share code, notes, and snippets.

@gregplaysguitar
Created September 15, 2021 10:05
Show Gist options
  • Save gregplaysguitar/e57c1b034ff7fbb0677684d20b34fde6 to your computer and use it in GitHub Desktop.
Save gregplaysguitar/e57c1b034ff7fbb0677684d20b34fde6 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 cardMachine = Machine({
id: 'card',
initial: 'draft',
states: {
draft: {
on: {
PUBLISH: 'locked'
}
},
locked: {
on: {
PUBLISH: 'published',
EDIT: 'draft'
}
},
published: {
on: {
ARCHIVE: 'archived',
EDIT: 'draft'
}
},
archived: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment