fix(core): push emit handlers into listeners set

This commit is contained in:
braks
2023-10-30 13:36:07 +01:00
committed by Braks
parent 0bf12601df
commit 2ecd8def81
2 changed files with 4 additions and 1 deletions
@@ -8,6 +8,7 @@ import { tryOnScopeDispose } from '@vueuse/core'
*/
export interface EventHookExtended<T> extends EventHook<T> {
hasListeners: () => boolean
fns: Set<(param: T) => void>
}
export function createExtendedEventHook<T = any>(defaultHandler?: (param: T) => void): EventHookExtended<T> {
@@ -50,5 +51,6 @@ export function createExtendedEventHook<T = any>(defaultHandler?: (param: T) =>
off,
trigger,
hasListeners,
fns,
}
}