Skip to content

Instantly share code, notes, and snippets.

@rajivr
Created August 26, 2021 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajivr/e56539b4b2090095d98ecc14dc1a07fb to your computer and use it in GitHub Desktop.
Save rajivr/e56539b4b2090095d98ecc14dc1a07fb to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const iteratorMachine = Machine({
id: 'IteratorMachine',
initial: 'fetching',
context: {
// ** state machine global **
// immutable
transaction: '',
_marker: '',
snapshot: '',
options_mode: '',
options_reverse: '',
// mutable
iteration: '',
options_limit: '',
begin: '',
end: '',
// ** state: fetching **
// immutable
fut_key_value_array: '',
// ** state: kv_array_available **
// immutable
more: '',
// mutable
kv_array: '',
},
states: {
fetching: {
on: {
FETCH_OK: 'kv_array_available',
FETCH_ERROR: 'error',
}
},
kv_array_available: {
on: {
FETCH_NEXT_BATCH: 'fetching',
DONE: 'done',
},
entry: [
'update:options_limit',
'update:iteration',
'update: begin',
'update: end'
],
},
error: {
type: 'final'
},
done: {
type: 'final'
}
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment