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
+2 -1
View File
@@ -69,7 +69,8 @@ export function useHooks(emit: (...args: any[]) => void, hooks: Ref<FlowHooks>)
emit(key, data)
}
value.on(listener)
// push into fns instead of using `on` to avoid overwriting default handlers - the emits should be called in addition to the default handlers
value.fns.add(listener)
tryOnScopeDispose(() => {
value.off(listener)