Created
September 29, 2020 20:25
-
-
Save thiagoadsix/fb5b94fb5292527d2205a494398cc552 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
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({ | |
id: 'fetch', | |
initial: 'choosing', | |
states: { | |
choosing: { | |
type: 'parallel', | |
states: { | |
squire: { | |
initial: 'querying', | |
states: { | |
querying: { | |
on: { | |
TO_SELECTING: 'selecting' | |
} | |
}, | |
selecting: { | |
initial: 'waitingAnswer', | |
states: { | |
waitingAnswer: { | |
}, | |
queryingAgain: { | |
on: { | |
'': 'validating' | |
} | |
}, | |
validating: { | |
on: { | |
SQUIRE_NOT_AVAILABLE: 'not_available', | |
SQUIRE_AVAILABLE: 'waitingAnswer' | |
} | |
}, | |
not_available: { | |
on: { | |
'': 'waitingAnswer' | |
} | |
} | |
}, | |
on: { | |
ACTION_ID: '.queryingAgain' | |
} | |
} | |
} | |
} | |
} | |
}, | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment