Skip to content

Instantly share code, notes, and snippets.

@RainerAtSpirit
Created November 18, 2019 16:41
Show Gist options
  • Save RainerAtSpirit/e6113f1c1be32701850b873f7053d0b0 to your computer and use it in GitHub Desktop.
Save RainerAtSpirit/e6113f1c1be32701850b873f7053d0b0 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: 'categoriesMachine',
initial: 'idle',
context: {
categoryMap: {},
categoryId: '',
actor: undefined,
actorMap: {},
level: 0,
result: {}
},
states: {
idle: {
on: {
SET_CONFIG: {
target: 'selected',
actions: 'onSetConfig'
}
}
},
selected: {
on: {
UPDATE_CATEGORY_MAP: {
target: 'loaded',
actions: 'onUpdateCategoryMap'
}
}
},
loaded: {}
},
on: {
SELECT: {
target: '.selected',
actions: 'onSelect'
},
LOAD_ROOT: {
target: '.selected',
actions: 'onLoadRoot'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment