Skip to content

Instantly share code, notes, and snippets.

@leeovery
Last active July 25, 2020 10:14
Show Gist options
  • Save leeovery/afd56c1d23810574528257f5c779b3b6 to your computer and use it in GitHub Desktop.
Save leeovery/afd56c1d23810574528257f5c779b3b6 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
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