removeEventListener
Удалить ранее зарегистрированный обработчик событий из глобальной области видимости
const listener = () => { console.log('hello'); };
addEventListener('load', listener);
removeEventListener('load', listener);
function removeEventListener<K extends keyof WindowEventMap>(type: K,listener: (this: Window, ev: WindowEventMap[K]) => any,options?: boolean | EventListenerOptions,): void;function removeEventListener(type: string,listener: EventListenerOrEventListenerObject,options?: boolean | EventListenerOptions,): void;
removeEventListener<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void
Удалить ранее зарегистрированный обработчик событий из глобальной области видимости
const listener = () => { console.log('hello'); };
addEventListener('load', listener);
removeEventListener('load', listener);
Параметры типов
K extends keyof WindowEventMapПараметры
type: Klistener: (this: Window, ev: WindowEventMap[K]) => anyoptions?: boolean | EventListenerOptions optionalТип возвращаемого значения
voidremoveEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): voidПараметры
type: stringlistener: EventListenerOrEventListenerObjectoptions?: boolean | EventListenerOptions optionalТип возвращаемого значения
void
© 2018–2022 the Deno authors
https://doc.deno.land/deno/stable/~/removeEventListener