Created
April 21, 2021 16:04
-
-
Save mogarick/3fa6285d83f68b21d2b64aaade494a8d 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({ | |
initial: "validatingAuthn", | |
states: { | |
validatingAuthn: { | |
on: { | |
SIGNED_IN: "authenticated", | |
SIGNED_OUT: "unauthenticated", | |
}, | |
}, | |
unauthenticated: { | |
on: { | |
SIGNED_IN: "authenticated", | |
SET_NEW_PASSWORD_REQUIRED: "settingNewPassword", | |
}, | |
}, | |
authenticated: { | |
on: { | |
SIGNED_OUT: "unauthenticated", | |
}, | |
}, | |
settingNewPassword: { | |
on: { | |
SET_NEW_PASSWORD_CANCELLED: "unauthenticated", | |
SIGNED_IN: "authenticated", | |
}, | |
}, | |
}, | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment