Last active
May 19, 2020 02:56
-
-
Save kellyjandrews/3a94c4f2b199e1a6a44d1c48a002998f 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
const authMachine = Machine({ | |
id: 'auth', | |
context: { | |
email: '', | |
password: '', | |
loginModal: false | |
}, | |
initial: 'unauthorized', | |
states: { | |
unauthorized: { | |
type: 'compound', | |
inital: `loginModal`, | |
states: { | |
loginModal:{ | |
on: { | |
ENTER_EMAIL: {}, | |
ENTER_PASSWORD: {}, | |
EMAIL_BLUR: {}, | |
PASSWORD_BLUR: {}, | |
SUBMIT: { | |
target: '.authPending' | |
} | |
} | |
}, | |
noLoginModal:{}, | |
googleAuth:{ | |
on: { | |
GOOGLE_AUTH: { | |
target: '.authPending' | |
} | |
} | |
}, | |
email_err:{ | |
on: { | |
ENTER_EMAIL: { | |
target: 'dataEntry', | |
} | |
} | |
}, | |
password_err:{} | |
} | |
}, | |
authError: {}, | |
authPending: {}, | |
authorized: {} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment