Last active
July 25, 2020 10:14
-
-
Save leeovery/afd56c1d23810574528257f5c779b3b6 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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 yapsMachine = Machine({ | |
id: 'yaps', | |
initial: 'loading', | |
context: { | |
User: {}, | |
yaps: null, | |
Yap: null, | |
}, | |
states: { | |
loading: { | |
invoke: { | |
id: 'fetch-yaps', | |
src: 'invokeFetchYaps', | |
onDone: { | |
target: 'idle', | |
actions: 'assignYapsFetchResult', | |
}, | |
onError: 'failure', | |
}, | |
}, | |
failure: { | |
on: { | |
RETRY: 'loading', | |
}, | |
}, | |
idle: { | |
entry: ['initConversationSystem'], | |
}, | |
selected: {}, | |
}, | |
on: { | |
SELECT: { | |
target: '.selected', | |
actions: 'spawnYapMachine', | |
}, | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment