Skip to content

Instantly share code, notes, and snippets.

@rajivr
Created August 25, 2021 11:44
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/90a9290ea523c8cf6be41a9da10a73bb to your computer and use it in GitHub Desktop.
Save rajivr/90a9290ea523c8cf6be41a9da10a73bb 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: {
global_immutable: {
transaction: '',
_marker: '',
snapshot: '',
options_mode: '',
options_reverse: '',
},
global_mutable: {
iteration: '',
options_limit: '',
begin: '',
end: '',
},
local: {
fetching: {
immutable: {
fut_key_value_array: '',
},
},
kv_array_available: {
immutable: {
more: '',
},
mutable: {
kvs: '',
}
}
},
},
states: {
fetching: {
on: {
FETCH_OK: 'kv_array_available',
FETCH_ERROR: 'error',
}
},
kv_array_available: {
on: {
FETCH_NEXT_BATCH: 'fetching',
DONE: 'done',
}
},
error: {
type: 'final'
},
done: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment