Created
May 5, 2021 15:21
-
-
Save tamebadger/8dc3c80266ff3fb770ef14692a6864df 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 fetchMachine = Machine({ | |
id: 'onboarding', | |
initial: 'pristine', | |
context: { | |
retries: 0 | |
}, | |
states: { | |
pristine: { | |
on: { | |
SUBMIT_DOCS: 'verification_pending' | |
} | |
}, | |
verification_pending: { | |
on: { | |
APPROVE: 'success', | |
REJECT: 'failure', | |
REJECT_WITH_RETRY: 'retry' | |
} | |
}, | |
failure: { | |
type: 'final' | |
}, | |
retry: { | |
on: { | |
APPROVE: 'success', | |
REJECT: 'failure', | |
REJECT_WITH_RETRY: 'retry' | |
} | |
}, | |
success: { | |
type: 'final' | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment