Skip to content

Instantly share code, notes, and snippets.

@mogarick
Created April 21, 2021 16:04
Show Gist options
  • Save mogarick/3fa6285d83f68b21d2b64aaade494a8d to your computer and use it in GitHub Desktop.
Save mogarick/3fa6285d83f68b21d2b64aaade494a8d 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 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