Last active
June 11, 2021 17:26
-
-
Save kdgerona/0f25bbc7c8fad227f8669e25682e633a to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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
const context = { | |
config: {}, | |
data: { | |
entity_id: '', | |
entity: 'users', | |
selected_navigation: '', | |
navigations: [], | |
browse: [], | |
fullScreenedComponent: { | |
component_name: '' | |
} | |
} | |
} | |
const config = { | |
id: 'full-dialog-container', | |
initial: 'load_navigations', | |
context, | |
states: { | |
load_navigations: { | |
// Possible to query browse navigation as well. | |
entry: ['getDialogMenuItems'], | |
on: { | |
SUCCESS: { | |
target: 'ready' | |
}, | |
FAILED: { | |
target: 'failed' | |
} | |
} | |
}, | |
ready: { | |
invoke: [], | |
on: { | |
CLOSE:{ | |
target: 'done', | |
}, | |
SELECT_NAVIGATION: { | |
actions: ['assignSelectedNavigation'] | |
}, | |
ADD_CHILD_NAVIGATION: { | |
actions: [ | |
'assignChildToNavigations', | |
'assignSelectedNavigation' | |
] | |
}, | |
CLOSE_NAVIGATION: [ | |
{ | |
cond: 'isParentNavigation', | |
target: 'done' | |
}, | |
{ | |
actions: ['updateSelectedToPrevNavigation'] | |
} | |
], | |
ZOOM_IN_COMPONENT: { | |
actions: ['assignFullScreenedComponent'] | |
}, | |
ZOOM_OUT_COMPONENT: { | |
actions: ['clearFullScreenedComponent'] | |
} | |
} | |
}, | |
done: { | |
type: 'final' | |
}, | |
failed: { | |
entry: ['sendParentErrorMessage'] | |
} | |
} | |
} | |
const implementations = { | |
actions: {} | |
} | |
const machine = Machine(config, implementations) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment