Files
vue-flow/src/composables/useVueFlow.ts
T
Braks 6a1571e6e3 fix: Flow not properly pre-loading state
* pass key to initFlow to possibly find a pre-existing state

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-20 00:40:42 +01:00

11 lines
344 B
TypeScript

import useStore from './useStore'
import useHooks from './useHooks'
import { EmitFunc, FlowOptions, FlowStore } from '~/types'
export const initFlow = (emit: EmitFunc, key?: string, store = useStore(undefined, key)) => {
useHooks(store, emit)
return store
}
export default (options?: Partial<FlowOptions>): FlowStore => useStore(options)