Last active
December 10, 2020 19:38
-
-
Save Denys-Bushulyak/17c113111003e08b7b9e2a6dae90eb01 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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
// 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