Skip to content

Instantly share code, notes, and snippets.

@colebemis
Last active December 14, 2019 19:39
Show Gist options
  • Save colebemis/c96ff5c8a1d1e04e63fa2998c4029191 to your computer and use it in GitHub Desktop.
Save colebemis/c96ff5c8a1d1e04e63fa2998c4029191 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: 'closed',
states: {
closed: {
on: {
OPEN: 'open'
}
},
open: {
on: {
CLOSE: 'closed'
},
initial: 'compose',
states: {
compose: {
on: {
SEND: 'sending'
}
},
sending: {
on: {
RESOLVE: 'sent',
REJECT: 'error'
}
},
sent: {type:'final'},
error: {
on: {
SEND: 'sending',
}
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment