Last active
July 13, 2020 10:52
-
-
Save JamieMason/446eb971c2c1dc3b9e55043e72e97f22 to your computer and use it in GitHub Desktop.
checkoutMachine: 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 checkoutMachine = Machine( | |
{ | |
id: "checkout", | |
initial: "validating", | |
context: {}, | |
states: { | |
// validate the inital props and | |
// decide whether it's safe to | |
// start up or whether to bail | |
validating: { | |
on: { | |
"": [ | |
{ | |
cond: "hasError", | |
target: "broken", | |
}, | |
{ target: "started" }, | |
], | |
}, | |
}, | |
broken: {}, | |
started: { | |
type: "parallel", | |
states: { | |
a: {} | |
}, | |
}, | |
}, | |
}, | |
{ | |
guards: { | |
hasError: (ctx, event) => false | |
}, | |
actions: {}, | |
services: {}, | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment