Skip to content

Instantly share code, notes, and snippets.

@jamestharpe
Created March 11, 2021 15:22
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 jamestharpe/9d14cc8b95d3b1eb5800869d9dea3a9f to your computer and use it in GitHub Desktop.
Save jamestharpe/9d14cc8b95d3b1eb5800869d9dea3a9f 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 gasStation = Machine({
"id": "gas-pump",
"initial": "prepayment",
"states": {
"prepayment": {
"on": {
"PRE_PAY": "grade"
}
},
"grade": {
"on": {
"SELECT": "pump"
}
},
"pump": {
"on": {
"PUMP": "done"
}
},
"done": {
"on": {
"RESET": "prepayment"
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment