Skip to content

Instantly share code, notes, and snippets.

@ajainarayanan
Created March 16, 2021 05:03
Show Gist options
  • Save ajainarayanan/72d5d07dc5ae28d4f5483f867ceec754 to your computer and use it in GitHub Desktop.
Save ajainarayanan/72d5d07dc5ae28d4f5483f867ceec754 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'Program Control',
initial: 'STOPPED',
context: {
retries: 0,
},
states: {
LOADING: {
on: {
RUN: 'RUNNING',
STOP: 'STOPPED',
FAIL: 'STOPPED',
}
},
RUNNING: {
on: {
STOP: 'LOADING'
}
},
STOPPED: {
on: {
START: 'LOADING'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment