update: remove useHooks usage

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-18 23:17:09 +01:00
parent 99dbd4b2cc
commit 470ab3782a
16 changed files with 97 additions and 81 deletions
+5 -5
View File
@@ -1,10 +1,10 @@
import useHooks from './useHooks'
import useStore from './useStore'
import { EmitFunc } from '~/types'
import { EmitFunc, FlowOptions } from '~/types'
export const initFlow = (emit: EmitFunc) => {
const store = useStore()
const hooks = useHooks(emit)
export const initFlow = (emit: EmitFunc, options: Partial<FlowOptions>) => {
const store = useStore(options)
const hooks = useHooks(store, emit)
return {
store,
@@ -12,4 +12,4 @@ export const initFlow = (emit: EmitFunc) => {
}
}
export default () => useStore()
export default (options?: Partial<FlowOptions>) => useStore(options)