Skip to content

Instantly share code, notes, and snippets.

@vignestion
Created February 25, 2021 20:46
Show Gist options
  • Select an option

  • Save vignestion/9dbaa44cc00cf9cbe92e1ff59fcda17a to your computer and use it in GitHub Desktop.

Select an option

Save vignestion/9dbaa44cc00cf9cbe92e1ff59fcda17a to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const pizzaStateMachine = Machine({
id:'pizzaStateMachine',
initial:'setType',
context:{
statue:'Decideing',
type:'Peperoni',
toppings: 'Lotsa toppings',
address:'My home address'
},
states: {
setType: {
on: {
NEXT: "setToppings"
}
},
setToppings: {
on: {
PREV:"setType",
NEXT: "setAddress"
}
},
setAddress: {
on: {
PREV:"setToppings",
NEXT: "setBaking"
}
},
setBaking: {},
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment