Skip to content

Instantly share code, notes, and snippets.

@fidoogle
Created December 30, 2019 15:59
Show Gist options
  • Select an option

  • Save fidoogle/3ea38290f9919a65d694ff59265a46c6 to your computer and use it in GitHub Desktop.

Select an option

Save fidoogle/3ea38290f9919a65d694ff59265a46c6 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 allData = new Array(25).fill(0).map((_val, i) => i + 1);
const perPage = 10;
const dataMachine = new Machine({
id: 'dataMachine',
initial: 'loading',
states: {
loading: {
on: {
DONE_MORE: 'more',
DONE_COMPLETE: 'complete',
FAIl: 'failure'
}
},
more: {},
complete: {
type: 'final'
},
failure:{
type: 'final'
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment