Skip to content

Instantly share code, notes, and snippets.

@wickstargazer
Created October 7, 2020 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wickstargazer/ad5df34b64659eca873e227e369b969d to your computer and use it in GitHub Desktop.
Save wickstargazer/ad5df34b64659eca873e227e369b969d 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 prMachine = {
initial: 'Create Pull Request',
states: {
'Create Pull Request': {
on: {
PrCreated: 'Move task to In Progress'
}
},
'Move task to In Progress': {
on: {
ApprovedAndRelease: 'Close Issue'
}
},
'Close Issue': {
on: {
OnClosed: 'Move task to Done'
}
},
'Move task to Done': {
}
}
}
const issueMachine = Machine({
id: 'Create Issue',
initial: 'Create Issue',
context: {
retries: 0
},
states: {
'Create Issue': {
on: {
Created: 'Task On Board'
}
},
'Task On Board': {
on: {
Descision: 'Create Milestone'
}
},
'Create Milestone': {
on: {
Created: 'Create Events in Google Calendar'
},
...prMachine
},
'Create Events in Google Calendar': {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment