Last active
November 24, 2019 00:12
-
-
Save dimsuz/9ebf7bd8bb657f0b7f0381ae680de6a5 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
// 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