Skip to content

Instantly share code, notes, and snippets.

@mu-hun
Last active July 3, 2020 03:03
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 mu-hun/599ede3dfc0cadda1ebf9919609b641c to your computer and use it in GitHub Desktop.
Save mu-hun/599ede3dfc0cadda1ebf9919609b641c to your computer and use it in GitHub Desktop.
const fetchMachine = Machine({
initial: 'idle',
states: {
idle: {
on: {
SUBMIT: 'submit',
},
},
submit: {
on: {
CORRECT: 'correct',
INVALID: 'invalid',
BLOCKED: 'blocked',
},
},
invalid: {
on: { SUBMIT: 'submit' },
},
correct: {
type: 'final',
},
blocked: {
type: 'final',
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment