Created
November 2, 2020 09:40
-
-
Save basanth-ivoyant/7f8010f6650e18dc8b6ad74d959b8c93 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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