Skip to content

Instantly share code, notes, and snippets.

@Vestride
Created July 27, 2021 22:42
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 Vestride/b661bff3f9f756b151bcc953814f1700 to your computer and use it in GitHub Desktop.
Save Vestride/b661bff3f9f756b151bcc953814f1700 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": "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