Skip to content

Instantly share code, notes, and snippets.

@faneder
Last active September 30, 2020 11:21
Show Gist options
  • Save faneder/84f6ddb2c09439611bae06483a356a89 to your computer and use it in GitHub Desktop.
Save faneder/84f6ddb2c09439611bae06483a356a89 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const getWorklistItems = () => {};
const fetchMachine = Machine({
id: 'fetch',
type: 'parallel',
context: {
},
states: {
page: {
initial: 'idle',
states: {
idle: {}
}
},
autoRefresh: {
initial: 'waiting',
states: {
waiting: {
after: {
2000: 'requesting',
}
},
requesting: {
invoke: {
id: 'getWorklistItems',
src: getWorklistItems,
onDone: [
{
target: 'waiting',
},
],
onError: {target: 'waiting'}
},
},
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment