Skip to content

Instantly share code, notes, and snippets.

@wlee221
Created June 24, 2021 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wlee221/54bdd4db735f8ed7def646abeb7c1ef4 to your computer and use it in GitHub Desktop.
Save wlee221/54bdd4db735f8ed7def646abeb7c1ef4 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
Machine(
{
id: 'signUp',
initial: "edit",
exit: ["clearFormValues", "clearError"],
states: {
edit: {
on: {
SUMBIT: "submit"
}
},
error: {
on: {
SUMBIT: "submit"
}
},
submit: {
invoke: {
src: "signIn",
onDone: {
actions: "setUser",
target: "resolved"
},
onError: {
actions: "setCognitoError",
target: 'error'
}
}
},
resolved: {
type: 'final'
}
},
},
{
guards: {
pwMatches: (context, event) => {
return false;
},
},
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment