Skip to content

Instantly share code, notes, and snippets.

@darrenjennings
Created February 25, 2021 17:33
Show Gist options
  • Save darrenjennings/0efba704ddf966de8e63b23f4fbc8a5c to your computer and use it in GitHub Desktop.
Save darrenjennings/0efba704ddf966de8e63b23f4fbc8a5c 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: 'CONTACT',
initial: 'idle',
states: {
idle: {
on: { CLICK_CONTACT_SALES: 'pending' }
},
pending: {
on: { RESOLVE: 'success', REJECT: 'error' }
},
error: {
on: { CLICK_CONTACT_SALES: 'idle' }
},
success: {
on: { CLICK_CONTACT_SALES: 'idle' }
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment