Created
February 9, 2021 09:08
-
-
Save kuroski/b322d9a50848d20445979c95c21d245b 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 exposePreparationState = { | |
initial: "load_deal", | |
states: { | |
load_deal: { | |
on: { | |
RESOLVE: "load_expose_data", | |
// REJECT: "^finish_with_error" | |
} | |
}, | |
load_expose_data: { | |
on: { | |
RESOLVE: "decode_expose_data", | |
// REJECT: "^finish_with_error" | |
} | |
}, | |
decode_expose_data: { | |
on: { | |
RESOLVE: "", | |
REJECT: "#appMachine.finish_with_error" | |
} | |
}, | |
} | |
} | |
const appMachine = Machine({ | |
id: 'appMachine', | |
initial: 'idle', | |
context: {}, | |
states: { | |
idle: { | |
on: { | |
APP_MOUNTED: 'loading' | |
} | |
}, | |
loading: { | |
...exposePreparationState | |
}, | |
finish_with_error: { | |
type: "final" | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment