Skip to content

Instantly share code, notes, and snippets.

@sgregson
Created October 7, 2021 21:01
Show Gist options
  • Save sgregson/1a0ada901cb3e2ff44854f7b6ea45029 to your computer and use it in GitHub Desktop.
Save sgregson/1a0ada901cb3e2ff44854f7b6ea45029 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 acceptedState = {
id: "accepted",
initial: "defined",
states: {
defined: {},
ticketized: {},
["in progress"]: {},
complete: {},
},
};
const fetchMachine = Machine({
id: "Homebase Proposals",
initial: "need identified",
states: {
["need identified"]: {
on: {
CREATE_PROPOSAL: "iterate",
},
},
iterate: {
on: {
REFINE: "iterate",
GOOD_ENOUGH: "office hours",
},
},
["office hours"]: {
on: {
NEEDS_REFINEMENT: "iterate",
CLEAR_ENOUGH: "ready for review",
},
},
["ready for review"]: {
on: {
TOP_OF_THE_QUEUE: "in review",
},
},
["in review"]: {
on: {
ACCEPTED: "accepted",
REJECTED: "rejected",
UNCLEAR_SYSTEM_IMPLEMENTATION: "iterate",
UNCLEAR_SYSTEM_VALUE: "iterate",
},
},
accepted: {
...acceptedState,
},
rejected: {},
dropped: {
on: {
VALUE_DEFINED: "iterate",
},
},
},
on: {
DEEMED_NOT_USEFUL: "dropped",
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment