Skip to content

Instantly share code, notes, and snippets.

@rjdestigter
Last active September 7, 2020 17:40
Show Gist options
  • Save rjdestigter/28a821ecb83f1f8be9a6e86f0879b5d2 to your computer and use it in GitHub Desktop.
Save rjdestigter/28a821ecb83f1f8be9a6e86f0879b5d2 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: 'fetch',
initial: 'noop',
context: {
retries: 0
},
states: {
noop: {
on: { BUSY: 'busy' }
},
busy: {
initial: 'foo',
on: {
RUN: {
actions: () => alert('busy')
}
},
states: {
foo: {
on: {
RUN: {
actions: () => alert('foo')
}
},
},
bar: {}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment