Skip to content

Instantly share code, notes, and snippets.

@chuanqisun
Last active July 31, 2019 00:06
Show Gist options
  • Save chuanqisun/7c835d985d143f240d4844f4dc735d00 to your computer and use it in GitHub Desktop.
Save chuanqisun/7c835d985d143f240d4844f4dc735d00 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: 'Start',
states: {
"Start": {
on: {
CREATE: 'Private editing',
}
},
"Private editing": {
on: {
CHECKIN: 'Private stowed',
EDIT: 'Private editing',
SAVE: 'Private editing',
DISCARD: 'Private stowed',
}
},
"Private stowed": {
on: {
CHECKOUT: 'Private editing',
PUBLISH: 'Public stowed',
}
},
"Public stowed": {
on: {
CHECKOUT: 'Public editing',
PUBLISH: 'Public stowed',
UNPUBLISH: 'Private stowed',
}
},
"Public editing": {
on: {
CHECKIN: 'Public stowed',
EDIT: 'Public editing',
SAVE: 'Public editing',
DISCARD: 'Public stowed',
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment