Skip to content

Instantly share code, notes, and snippets.

@PutziSan
Created June 13, 2022 13:37
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 PutziSan/1cbaf9758a372825191f7942fb37c654 to your computer and use it in GitHub Desktop.
Save PutziSan/1cbaf9758a372825191f7942fb37c654 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
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