Skip to content

Instantly share code, notes, and snippets.

@Vestride
Created Jul 27, 2021
Embed
What would you like to do?
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": "manageInsuranceFlow",
"initial": "IDLE",
"context": {
"stores": null,
"error": null
},
"states": {
"IDLE": {
"invoke": {
"id": "loadUserDataAndValidate",
"src": "loadUserDataAndValidate",
"onDone": {
"target": "#manageInsuranceFlow.MANAGE"
},
"onError": {
"actions": "setErrorData",
"target": "#manageInsuranceFlow.INVALID_USER_STATE"
}
}
},
"MANAGE": {
"on": {
"NEXT": [
{
"target": "#manageInsuranceFlow.AGREEMENT"
}
]
}
},
"AGREEMENT": {
"on": {
"BACK": [
{
"target": "#manageInsuranceFlow.MANAGE"
}
],
"NEXT": [
{
"target": "#manageInsuranceFlow.CONFIRMATION"
}
]
}
},
"INVALID_USER_STATE": {
"type": "final"
},
"CONFIRMATION": {
"type": "final"
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment