feat(flow): Add option to disable default change handlers globally

* overwrites applyDefault setting for useEdgeState/useNodeState/useElementsState
* export apply change handlers

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-12-20 19:29:52 +01:00
parent 423f6aa78d
commit e2e094b987
6 changed files with 19 additions and 5 deletions
+2
View File
@@ -88,6 +88,7 @@ export default (opts?: Partial<FlowState>): FlowState => {
hooks: createHooks(),
storageKey: undefined,
applyDefault: true,
vueFlowVersion: typeof __VUE_FLOW_VERSION__ !== 'undefined' ? __VUE_FLOW_VERSION__ : '-',
}
@@ -127,6 +128,7 @@ export default (opts?: Partial<FlowState>): FlowState => {
if (typeof opts.maxZoom !== 'undefined') state.maxZoom = opts.maxZoom
if (typeof opts.minZoom !== 'undefined') state.minZoom = opts.minZoom
if (typeof opts.translateExtent !== 'undefined') state.translateExtent = opts.translateExtent
if (typeof opts.applyDefault !== 'undefined') state.applyDefault = opts.applyDefault
}
return state