Skip to content

Instantly share code, notes, and snippets.

@karfau
Created February 2, 2021 20:09
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 karfau/0444f2395a9cca20c232de943d0b2bf0 to your computer and use it in GitHub Desktop.
Save karfau/0444f2395a9cca20c232de943d0b2bf0 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": "decision-process",
"initial": "problem",
"context": {
"assignee": "who?when?",
"stakeholders": "anybody affected",
"timeInvested": 0,
"painLevel": 0,
"costOfChange": 0,
"relatedResources": []
},
"states": {
"problem": {
"on": {
"FITS_IN_1_PR": "implementation",
"PAIN_AND_IDEA": "draft_rfc"
}
},
"draft_rfc": {
"on": {
"READY": "review_rfc",
"IDLE": "decide_rfc",
"LOST_INTEREST": [{ "action": "closeRfc", "target": "problem" }]
}
},
"review_rfc": {
"on": {
"OBJECTION": [
{ "cond": "wants_to_invest_more_time", "target": "draft_rfc" },
{ "action": "closeRfc", "target": "problem" }
],
"IDLE": "decide_rfc",
"LOST_INTEREST": [{ "action": "closeRfc", "target": "problem" }]
}
},
"decide_rfc": {
"on": {
"OBJECTION": [
{ "cond": "wants_to_invest_more_time", "target": "draft_rfc" },
{ "action": "closeRfc", "target": "problem" }
],
"LOST_INTEREST": [{ "action": "closeRfc", "target": "problem" }],
"NO_OBJECTION": [
{
"cond": "actionable",
"action": "mergeRfc",
"target": "implementation"
},
{
"target": "problem_and_decision"
}
]
}
},
"problem_and_decision": {
"on": {
"SOME_MAGIC": "implementation"
}
},
"implementation": {
"type": "final"
}
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment