Skip to content

Instantly share code, notes, and snippets.

@dfcarpenter
Last active November 26, 2019 00:50
Show Gist options
  • Save dfcarpenter/4072f58012e774ac4a7faac55b0c3132 to your computer and use it in GitHub Desktop.
Save dfcarpenter/4072f58012e774ac4a7faac55b0c3132 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: 'draft',
context: {
retries: 0
},
states: {
draft: {
on: {
SAVE: 'review'
}
},
review: {
on: {
SUGGEST: 'reviewChange',
PUBLISH: 'publish'
}
},
reviewChange: {
on: {
SUGGEST: 'review',
}
},
publish: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment