Skip to content

Instantly share code, notes, and snippets.

@entorenee
Created July 21, 2020 22:14
Show Gist options
  • Save entorenee/ab4ff07dc1b026cdbc2d7388e7dd94f1 to your computer and use it in GitHub Desktop.
Save entorenee/ab4ff07dc1b026cdbc2d7388e7dd94f1 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({
initial: 'idle',
states: {
idle: {
on: {
FETCH: 'loading'
}
},
loading: {
on: {
SUCCESS: 'success',
FAILURE: 'failure',
}
},
success: {
on: {
FETCH: 'loading'
}
},
failure: {
on: {
FETCH: 'loading'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment