Skip to content

Instantly share code, notes, and snippets.

@joshpitzalis
Last active February 20, 2020 04:09
Show Gist options
  • Save joshpitzalis/e51de4a18bd4d19a84ecb3f15bba5ef2 to your computer and use it in GitHub Desktop.
Save joshpitzalis/e51de4a18bd4d19a84ecb3f15bba5ef2 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: 'contactChunks',
initial: 'idle',
states: {
idle: {
on: {
FETCHED: 'loading',
ALREADY_FETCHED:'selector',
}
},
loading: {
on: {
RESOLVED: 'selector',
REJECTED: 'error'
}
},
selector: {
onEntry: ['deduplicate', 'preSelect'],
on: {
SELECTED: 'selector',
CANCELLED: 'idle',
REVEALED_MORE:'selector',
}
},
error: {
on: {
RETRIED: 'loading'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment