Last active
July 3, 2020 03:03
-
-
Save mu-hun/599ede3dfc0cadda1ebf9919609b641c to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz/?gist=599ede3dfc0cadda1ebf9919609b641c
This file contains 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 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