return stopper function as the result of record
This commit is contained in:
@@ -11,8 +11,9 @@ export function on(
|
||||
fn: EventListenerOrEventListenerObject,
|
||||
target: Document | Window = document,
|
||||
): listenerHandler {
|
||||
target.addEventListener(type, fn, { capture: true, passive: true });
|
||||
return () => target.removeEventListener(type, fn);
|
||||
const options = { capture: true, passive: true };
|
||||
target.addEventListener(type, fn, options);
|
||||
return () => target.removeEventListener(type, fn, options);
|
||||
}
|
||||
|
||||
export const mirror: Mirror = {
|
||||
|
||||
Reference in New Issue
Block a user