Skip to content

Instantly share code, notes, and snippets.

@Denys-Bushulyak
Last active December 10, 2020 19:38
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 Denys-Bushulyak/17c113111003e08b7b9e2a6dae90eb01 to your computer and use it in GitHub Desktop.
Save Denys-Bushulyak/17c113111003e08b7b9e2a6dae90eb01 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 ExpressionBuilderMachine = Machine({
id: 'expression-builder',
initial: 'editor',
context: {
retries: 0
},
states: {
editor: {
on:{
EDIT:'editor',
SELECT_CATEGORY:'catalog.history',
}
},
catalog:{
id: 'catalog',
initial: 'init',
on:{
SELECT_EDITOR:'editor',
SELECT_FUNCTION:'editor',
SELECT_REFERENCE:'editor',
},
states:{
history:{
type:'history',
target: 'category'
},
init:{
on:{
SELECT_CATEGORY:'category'
}
},
category:{
on:{
SELECT_SUB_CATEGORY:'sub_category'
}
},
sub_category:{
on:{
SELECT_CATEGORY:'category',
}
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment