* pass key to initFlow to possibly find a pre-existing state Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
11 lines
344 B
TypeScript
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)
|