Skip to content

Instantly share code, notes, and snippets.

@dpraimeyuu
Created April 16, 2021 17:16
Show Gist options
  • Save dpraimeyuu/b1ccee984ba52b888721264b2dd5f922 to your computer and use it in GitHub Desktop.
Save dpraimeyuu/b1ccee984ba52b888721264b2dd5f922 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: 'WORKFLOW',
initial: 'IDLE',
context: {
retries: 0
},
states: {
"IDLE": {
on: {
"CREATE_ISSUE": "OPEN"
}
},
"OPEN": {
on: {
"RESOLVE_ISSUE": "RESOLVED",
"CLOSE_ISSUE": "CLOSED",
"START_PROGRESS": "IN_PROGRESS"
}
},
"RESOLVED": {
on: {
"REOPEN_ISSUE": "REOPENED",
"CLOSE_ISSUE": "CLOSED"
}
},
"CLOSED": {
on: {
"REOPEN_ISSUE": "REOPENED"
}
},
"REOPENED": {
on: {
"RESOLVE_ISSUE": "RESOLVED",
"CLOSE_ISSUE": "CLOSED",
"START_PROGRESS": "IN_PROGRESS"
}
},
"IN_PROGRESS": {
on: {
"CLOSE_ISSUE": "CLOSED",
"RESOLVE_ISSUE": "RESOLVED",
"STOP_PROGRESS": "OPEN"
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment