From 6a68292f7c4fc4e83f3689473f77c9a0e29cad98 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Fri, 19 Nov 2021 23:43:25 +0100 Subject: [PATCH] feat: merge store with props * if options are passed to useVueFlow, we want to merge them with possibly passed props * renamed flowStore to stateStore * fix examples * add store prop to pass an already existing store to flow Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com> --- examples/Basic/Basic.vue | 2 + examples/DragNDrop/DnD.vue | 18 +---- examples/Empty/EmptyExample.vue | 2 +- examples/Provider/Sidebar.vue | 4 +- examples/RGBFlow/RGBFlow.vue | 7 +- examples/RGBFlow/RGBOutputNode.vue | 2 +- postcss.config.js | 1 - .../ConnectionLine/ConnectionLine.vue | 2 +- src/components/Edges/Edge.vue | 2 +- src/components/Handle/Handle.vue | 2 +- src/composables/useHandle.ts | 9 +-- src/composables/useStore.ts | 6 +- src/composables/useVueFlow.ts | 13 +--- src/container/VueFlow/VueFlow.vue | 77 +++++++++---------- src/store/index.ts | 16 +++- src/store/{flowStore.ts => stateStore.ts} | 0 src/types/edge.ts | 2 +- src/types/store.ts | 4 +- src/types/types.ts | 7 +- 19 files changed, 80 insertions(+), 96 deletions(-) rename src/store/{flowStore.ts => stateStore.ts} (100%) diff --git a/examples/Basic/Basic.vue b/examples/Basic/Basic.vue index 1d0d1067..ae9a8af7 100644 --- a/examples/Basic/Basic.vue +++ b/examples/Basic/Basic.vue @@ -13,6 +13,7 @@ import { isNode, removeElements, Node, + useVueFlow, } from '~/index' const onNodeDragStop = ({ node }: { node: Node }) => console.log('drag stop', node) @@ -54,6 +55,7 @@ const toggleclasss = () => { return el }) } +useVueFlow()