Created
November 5, 2019 03:48
-
-
Save h-jennings/656ab9c0c92a67ef294346ae7319b127 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const allData = new Array(25).fill(0).map((_val, i) => i + 1); | |
const perPage = 10; | |
const dataMachine = new Machine({ | |
id: 'dataMachine', | |
initial: 'loading', | |
context: { | |
data: [], | |
}, | |
states: { | |
loading: { | |
on: { | |
DONE_MORE: 'more', | |
DONE_COMPLETE: 'complete', | |
FAIL: 'failure', | |
} | |
}, | |
more: { | |
on: { | |
LOAD: 'loading', | |
} | |
}, | |
complete: { | |
type: 'final', | |
}, | |
failure: { | |
type: 'final', | |
}, | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment