feat(store): add store as refs to useVueFlow

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 be725c6d2d
commit 91009e1dca
8 changed files with 46 additions and 29 deletions
+2 -1
View File
@@ -15,7 +15,7 @@ export const defaultEdgeTypes: DefaultEdgeTypes = {
smoothstep: SmoothStepEdge,
}
export default (): FlowState => ({
export default (preloadedState?: Partial<FlowState>): FlowState => ({
nodes: [],
edges: [],
@@ -87,4 +87,5 @@ export default (): FlowState => ({
storageKey: undefined,
vueFlowVersion: typeof __VUE_FLOW_VERSION__ !== 'undefined' ? __VUE_FLOW_VERSION__ : '-',
...preloadedState,
})