Skip to content

Instantly share code, notes, and snippets.

@dimsuz
Last active November 24, 2019 00:12
Show Gist options
  • Save dimsuz/9ebf7bd8bb657f0b7f0381ae680de6a5 to your computer and use it in GitHub Desktop.
Save dimsuz/9ebf7bd8bb657f0b7f0381ae680de6a5 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 loginStates = {
id: 'login_screen',
initial: 'login',
states: {
login: {
}
}
}
const otpStates = {
id: 'otp_screen',
initial: 'otp_intro',
states: {
otp_intro: {
on: {
'INTRO_CONTINUE': 'otp_input'
}
},
otp_input: {
}
}
}
const fetchMachine = Machine({
id: 'fetch',
initial: 'flow_login',
context: {
retries: 0
},
states: {
flow_login: {
on: {
SWITCH_TO_OTP: 'flow_otp'
},
...loginStates
},
flow_otp: {
on: {
},
...otpStates
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment