Skip to content

Instantly share code, notes, and snippets.

@Hydrock
Created January 24, 2020 09:31
Show Gist options
  • Save Hydrock/6fee268002df96720a15bbb46f2e821d to your computer and use it in GitHub Desktop.
Save Hydrock/6fee268002df96720a15bbb46f2e821d to your computer and use it in GitHub Desktop.
const machineConfig = {
id: 'signIn',
initial: 'dataEntry',
states: {
dataEntry: {
on: {
ENTER_EMAIL: {},
ENTER_PASSWORD: {},
EMAIL_BLUR: {},
PASSWORD_BLUR: {},
SUBMIT: {
target: 'awaitingResponse',
},
},
},
awaitingResponse: {},
emailErr: {
on: {
ENTER_EMAIL: {
target: 'dataEntry',
},
},
},
passwordErr: {
on: {
ENTER_PASSWORD: {
target: 'dataEntry',
},
},
},
serviceErr: {
on: {
SUBMIT: {
target: 'awaitingResponse',
},
},
},
signedIn: {},
},
};
export default machineConfig;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment