Created
August 28, 2019 18:28
-
-
Save tmbtech/778db1a2dc4e58066a7894397b4c9ae9 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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 fetchMachine = Machine({ | |
id: 'createUser_mergeBD', | |
context: { | |
username: undefined, | |
isPhoneVerified: undefined, | |
mergeToken: undefined, | |
}, | |
initial: 'idle', | |
states: { | |
idle: { | |
on: { | |
LOGIN_SUBMIT: 'pending', | |
}, | |
}, | |
pending: { | |
on: { | |
SUCCESS_NOT_VERIFIED: { | |
target: 'isNotVerified', | |
actions: 'pending_success_actions', | |
}, | |
SUCCESS_VERIFIED: { | |
target: 'isVerified' | |
} | |
}, | |
}, | |
isVerified: { | |
on: { | |
START_MIGRATION: { | |
target: 'migrationRunning', | |
}, | |
}, | |
}, | |
isNotVerified: {}, | |
migrationRunning: { | |
on: { | |
CHECK_STATUS: { | |
target: 'migrationRunning', | |
}, | |
MIGRATION_COMPLETE: { | |
target: 'migrationComplete', | |
}, | |
}, | |
}, | |
migrationComplete: {}, | |
}, | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment