Skip to content

Instantly share code, notes, and snippets.

@a8t
Last active December 31, 2019 22:24
Show Gist options
  • Save a8t/b6bd9f2309a73cab3697e763d2211134 to your computer and use it in GitHub Desktop.
Save a8t/b6bd9f2309a73cab3697e763d2211134 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: 'No invites',
context: {
retries: 0
},
states: {
'No invites': {
on: {
'Receive invite': 'Has open invite'
}
},
'Has open invite': {
on: {
"I'm interested": "Active job",
"Not interested" : 'No invites'
}
},
'Pending confirmation': {
on: {
"Confirm": "Active job",
"Cancel" : 'No invites'
}
},
'Active job':{
},
success: {
type: 'final'
},
failure: {
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment