Created
October 7, 2020 07:56
-
-
Save wickstargazer/ad5df34b64659eca873e227e369b969d to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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