Skip to content

Instantly share code, notes, and snippets.

@drskullster
Last active February 3, 2021 13:02
Show Gist options
  • Save drskullster/18c14d3f03f30bb4f04e517337f1ce45 to your computer and use it in GitHub Desktop.
Save drskullster/18c14d3f03f30bb4f04e517337f1ce45 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 authMachine = Machine({
id: 'auth',
initial: 'logIn',
context: {
retries: 0
},
states: {
logIn: {
on: {
SUCCESS: 'end',
FORGOTTEN: 'forgotPassword',
SUBSCRIBE: 'subscribe',
OAUTH_LOGIN: 'oauth'
}
},
forgotPassword: {
on: {
SUCCESS: 'success',
FORGOT_BACK: 'logIn'
}
},
subscribe: {
on: {
SUCCESS: 'success',
}
},
oauth: {
SUCCESS: 'success'
},
end: {
type: 'final'
},
success: {
type: 'final'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment