Created
June 13, 2022 13:37
-
-
Save PutziSan/1cbaf9758a372825191f7942fb37c654 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
const orderMachine = Machine({ | |
id: "createOrder", | |
initial: "cart", | |
states: { | |
cart: { | |
on: { | |
NEXT: "customer" | |
} | |
}, | |
customer: { | |
on: { | |
NEXT: "shipping", | |
CART: "cart" | |
} | |
}, | |
shipping: { | |
on: { | |
NEXT: "payment", | |
CART : "cart", | |
CUSTOMER: "customer", | |
} | |
}, | |
payment: { | |
on: { | |
NEXT: "review", | |
CART : "cart", | |
CUSTOMER: "customer", | |
SHIPPING: "shipping" | |
} | |
}, | |
review: { | |
CART : "cart", | |
CUSTOMER: "customer", | |
SHIPPING: "shipping", | |
PAYMENT: "payment", | |
type: "final" | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment