Skip to content

Instantly share code, notes, and snippets.

@wickstargazer
Created October 11, 2020 05:06
Show Gist options
  • Save wickstargazer/6c803abe4f89ae8b592eae7ba5dc9aa3 to your computer and use it in GitHub Desktop.
Save wickstargazer/6c803abe4f89ae8b592eae7ba5dc9aa3 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 Process',
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': {
on: {
OnUpdated: 'Comments on PR'
},
},
'Comments on PR': {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment