Skip to content

Instantly share code, notes, and snippets.

@pieh
Created November 19, 2019 12:49
Show Gist options
  • Save pieh/754683302af505f28015742703e3872e to your computer and use it in GitHub Desktop.
Save pieh/754683302af505f28015742703e3872e to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = Machine({
id: 'develop',
initial: 'idle',
context: {
retries: 0
},
states: {
idle: {
on: {
API_RUNNING_QUEUE_EMPTY: "sideEffects"
}
},
sideEffects: {
initial: `updateSchema`,
states: {
updateSchema: {
invoke: {
id: `maybeUpdateSchema`,
// maybe we need to re-extract queries if schema was rebuilt
onDone: `createPages`
}
},
createPages: {
invoke: {
id: `runCreatePagesExtensionPoint`,
onDone: `rerunQueries`
}
},
rerunQueries: {
invoke: {
id: `runQueries`,
onDone: `#develop.idle`
}
},
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment