Skip to content

Instantly share code, notes, and snippets.

@darrenjennings
Created January 13, 2021 19:35
Show Gist options
  • Save darrenjennings/b353683a60c99ec28a35632e67b68da0 to your computer and use it in GitHub Desktop.
Save darrenjennings/b353683a60c99ec28a35632e67b68da0 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: 'appearanceMachine',
initial: 'idle',
states: {
idle: { on: { CLICKED_SAVE: 'pending', FETCH: 'pending' } },
pending: { on: { RESOLVE: 'success', REJECT: 'error' } },
success: { on: { CLICKED_SAVE: 'pending', CLICKED_CANCEL: 'idle' } },
error: { on: { SUBMIT: 'pending' } }
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment