Skip to content

Instantly share code, notes, and snippets.

@felipeleusin
Created September 2, 2020 19:36
Show Gist options
  • Select an option

  • Save felipeleusin/a5fd1c2318338c5770d6c209b8c7a8d7 to your computer and use it in GitHub Desktop.

Select an option

Save felipeleusin/a5fd1c2318338c5770d6c209b8c7a8d7 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: 'campaign',
initial: 'draft',
context: {
retries: 0
},
states: {
draft: {
on: {
REVIEW: 'review'
}
},
review: {
on: {
SEND: 'sending',
SCHEDULE: 'scheduled',
EDIT: 'draft'
}
},
scheduled: {
on: {
SEND: 'sending',
EDIT: 'draft'
}
},
sending: {
on: {
SENT: 'sent',
CANCELLED: 'cancelled'
}
},
cancelled: {
type: 'final'
},
sent: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment