Created
September 14, 2020 19:39
-
-
Save mindrones/2ac413dd980ae6d6e743ef8e263411d1 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
Machine({ | |
"id": "TestingBuilder", | |
"type": "parallel", | |
"context": { | |
"autoExecute": false, | |
"cached": false, | |
"hideDisabledAxes": true, | |
"hideDisabledAggs": false, | |
"hideDisabledDatasets": false, | |
"hideDisabledItems": true, | |
"matching": false, | |
"selectionComplete": false, | |
"showFullResponse": false, | |
"queryReady": false | |
}, | |
"states": { | |
"GuardsConfig": { | |
"initial": "Idle", | |
"states": { | |
"Idle": { | |
"on": { | |
"SELECTION_COMPLETE_TOGGLED": { | |
"target": "Idle", | |
"actions": "toggleSelectionComplete" | |
}, | |
"QUERY_READY_TOGGLED": { | |
"target": "Idle", | |
"actions": "toggleQueryReady" | |
}, | |
"MATCHING_TOGGLED": { | |
"target": "Idle", | |
"actions": "toggleMatching" | |
}, | |
"CACHED_TOGGLED": { | |
"target": "Idle", | |
"actions": "toggleCached" | |
} | |
} | |
} | |
} | |
}, | |
"Route": { | |
"id": "Route", | |
"initial": "Loading", | |
"on": { | |
"ROUTE_CHANGED": { | |
"target": "#Route.Interactive", | |
"actions": [ | |
"resetForms", | |
"parseParams" | |
] | |
} | |
}, | |
"states": { | |
"Loading": { | |
"on": { | |
"READY": { | |
"target": "#Route.Interactive", | |
"actions": [ | |
"resetForms", | |
"parseParams" | |
] | |
} | |
} | |
}, | |
"Interactive": { | |
"type": "parallel", | |
"states": { | |
"History": { | |
"initial": "Saved", | |
"states": { | |
"Editing": { | |
"on": { | |
"EDITED": { | |
"target": "Editing", | |
"actions": "updateEntry" | |
}, | |
"REQUESTED": { | |
"target": "Saved", | |
"actions": "commitEntry" | |
} | |
} | |
}, | |
"Saved": { | |
"on": { | |
"EDITED": { | |
"target": "Editing", | |
"actions": "initEntry" | |
} | |
} | |
} | |
} | |
}, | |
"FormConfig": { | |
"initial": "Idle", | |
"states": { | |
"Idle": { | |
"on": { | |
"AUTO_EXEC_TOGGLED": { | |
"target": "Idle", | |
"actions": [ | |
"toggleAutoExecute", | |
"log" | |
] | |
}, | |
"FORM_SELECTED": { | |
"target": "Idle", | |
"actions": [ | |
"selectForm" | |
] | |
}, | |
"HIDE_DISABLED_FORMS_TOGGLED": { | |
"target": "Idle", | |
"actions": [ | |
"toggleHideDisabledForms" | |
] | |
}, | |
"HIDE_DISABLED_AGGS_TOGGLED": { | |
"target": "Idle", | |
"actions": [ | |
"toggleHideDisabledAggs" | |
] | |
}, | |
"HIDE_DISABLED_DSETS_TOGGLED": { | |
"target": "Idle", | |
"actions": [ | |
"toggleHideDisabledDatasets" | |
] | |
}, | |
"HIDE_DISABLED_FIELDS_TOGGLED": { | |
"target": "Idle", | |
"actions": [ | |
"toggleHideDisabledFields" | |
] | |
}, | |
"REQUEST_TAB_SELECTED": { | |
"target": "Idle", | |
"actions": [ | |
"setTab" | |
] | |
}, | |
"RESULT_SIZE_CHANGED": { | |
"target": "Idle", | |
"actions": [ | |
"computeRequest" | |
] | |
}, | |
"SHOW_FULL_RESPONSE_TOGGLED": { | |
"target": "Idle", | |
"actions": [ | |
"toggleShowFullResponse" | |
] | |
} | |
} | |
} | |
} | |
}, | |
"Docs": { | |
"initial": "Idle", | |
"states": { | |
"Idle": { | |
"on": { | |
"FIELD_DOC_SHOWN": { | |
"target": "Idle", | |
"actions": [ | |
"setFieldDoc" | |
] | |
}, | |
"FIELD_DOC_DEFAULT": { | |
"target": "Idle", | |
"actions": [ | |
"resetFieldDoc" | |
] | |
}, | |
"AGG_DOC_SHOWN": { | |
"target": "Idle", | |
"actions": [ | |
"setAggDoc" | |
] | |
}, | |
"AGG_DOC_DEFAULT": { | |
"target": "Idle", | |
"actions": [ | |
"resetAggDoc" | |
] | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, { | |
"actions": { | |
"toggleAutoExecute": { | |
"type": "xstate.assign", | |
"assignment": { | |
"autoExecute": ctx => !ctx.autoExecute | |
} | |
}, | |
"toggleCached": { | |
"type": "xstate.assign", | |
"assignment": { | |
"cached": ctx => !ctx.cached | |
} | |
}, | |
"toggleHideDisabledAxes": { | |
"type": "xstate.assign", | |
"assignment": { | |
"hideDisabledAxes": ctx => !ctx.hideDisabledAxes | |
} | |
}, | |
"toggleHideDisabledAggs": { | |
"type": "xstate.assign", | |
"assignment": { | |
"hideDisabledAggs": ctx => !ctx.hideDisabledAggs | |
} | |
}, | |
"toggleHideDisabledDatasets": { | |
"type": "xstate.assign", | |
"assignment": { | |
"hideDisabledDatasets": ctx => !ctx.hideDisabledDatasets | |
} | |
}, | |
"toggleHideDisabledItems": { | |
"type": "xstate.assign", | |
"assignment": { | |
"hideDisabledItems": ctx => !ctx.hideDisabledItems | |
} | |
}, | |
"toggleShowFullResponse": { | |
"type": "xstate.assign", | |
"assignment": { | |
"showFullResponse": ctx => !ctx.showFullResponse | |
} | |
}, | |
"toggleMatching": { | |
"type": "xstate.assign", | |
"assignment": { | |
"matching": ctx => !ctx.matching | |
} | |
}, | |
"toggleSelectionComplete": { | |
"type": "xstate.assign", | |
"assignment": { | |
"selectionComplete": ctx => !ctx.selectionComplete | |
} | |
}, | |
"toggleQueryReady": { | |
"type": "xstate.assign", | |
"assignment": { | |
"queryReady": ctx => !ctx.queryReady | |
} | |
} | |
}, | |
"guards": { | |
"isAutoExecute": ctx => ctx.autoExecute, | |
"isInCache": ctx => ctx.cached, | |
"isMatching": ctx => ctx.matching, | |
"isSelectionComplete": ctx => ctx.selectionComplete, | |
"isQueryReady": ctx => ctx.queryReady | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment