diff --git a/src/composables/useHooks.ts b/src/composables/useHooks.ts index b9e49b07..c4f472ff 100644 --- a/src/composables/useHooks.ts +++ b/src/composables/useHooks.ts @@ -11,7 +11,6 @@ import { FlowEvents, FlowStore, } from '~/types' -import { Hooks } from '~/context' // flow event hooks export const createHooks = (): FlowHooks => { @@ -66,14 +65,4 @@ const bind = (emit: EmitFunc, hooks: FlowHooks) => { } } -export default (store: FlowStore, emit?: EmitFunc) => { - let hooks = inject(Hooks, null)! - if (!hooks) { - if (import.meta.env.DEV) console.warn('hooks context not found; creating default hooks') - hooks = store.hooks - if (typeof emit === 'function') bind(emit, hooks) - provide(Hooks, hooks) - } - - return hooks -} +export default (store: FlowStore, emit: EmitFunc) => bind(emit, store.hooks) diff --git a/src/context/index.ts b/src/context/index.ts index 95df9a46..f115fdbd 100644 --- a/src/context/index.ts +++ b/src/context/index.ts @@ -1,6 +1,5 @@ import { InjectionKey } from 'vue' -import { ElementId, FlowHooks, FlowStore } from '~/types' +import { ElementId, FlowStore } from '~/types' export const Store: InjectionKey = Symbol('store') -export const Hooks: InjectionKey = Symbol('hooks') export const NodeId: InjectionKey = Symbol('nodeId')