Skip to content

Instantly share code, notes, and snippets.

@balazsorban44
Created November 1, 2019 11:18
Show Gist options
  • Save balazsorban44/727b37ec37943101013438534e49c826 to your computer and use it in GitHub Desktop.
Save balazsorban44/727b37ec37943101013438534e49c826 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = Machine({
id: 'useUpdateOrder',
initial: 'idle',
states: {
idle: {
on: {
NEW: 'product',
DISCOUNT: 'product',
ORDER_ID: 'product'
}
},
product: {
on: {
NEXT: 'registration',
}
},
registration: {
on: {
REGISTER: 'profile',
RETRYING_REGISTER: 'retry_registration',
LOGIN: 'profile',
BACK: 'product'
}
},
retry_registration: {
on: {
RESET: 'registration',
}
},
profile: {
on: {
NEXT: 'payment',
BACK: 'registration'
}
},
payment: {
on: {
NEXT: 'executed',
BACK: 'profile'
}
},
executed: {
type: 'executed'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment