Skip to content

Instantly share code, notes, and snippets.

@basanth-ivoyant
Created November 2, 2020 09:40
Show Gist options
  • Save basanth-ivoyant/7f8010f6650e18dc8b6ad74d959b8c93 to your computer and use it in GitHub Desktop.
Save basanth-ivoyant/7f8010f6650e18dc8b6ad74d959b8c93 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": "UpdateEquipment",
"initial": "start",
"context": {},
"states": {
"start": {
"on": {
"VALIDATE": "validate",
"CANCEL":"cancel"
}
},
"validate": {
"invoke": {
"id": "helpers-invokeService",
"src": "helpers-invokeService",
"onDone": {
"target": "waitForConfirmation"
},
"onError": {
"target": "error"
}
}
},
"waitForConfirmation": {
"on":{
"CONFIRM":"confirm",
"CANCEL":"cancel",
}
},
"confirm": {
"invoke": {
"id": "helpers-invokeService",
"src": "helpers-invokeService",
"onDone": {
"target": "complete"
},
"onError": {
"target": "error"
}
}
},
"error": {
"on":{
"VALIDATE":"validate",
"CANCEL":"cancel",
"COFIRM":"confirm"
}
},
"complete":{
"type":"final"
},
"cancel":{
"type":"final"
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment