Skip to content

Instantly share code, notes, and snippets.

@jamestharpe
Created March 11, 2021 15:22
Show Gist options
  • 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