Skip to main content
Go to Latest
method EventEmitter.prototype.addEventListener
import { EventEmitter } from "https://deno.land/x/evtemitter@v3.0.0/mod.ts";

add a callback to an event or multiple events

Type Parameters

Ev extends ReservedOrUserEventNames<ReservedEvents, UserEvents>

Parameters

type: Ev

the event name the callback should listen to

callback: ReservedOrUserListenerAddEventListener<ReservedEvents, UserEvents, Ev>

the callback to execute when the event is dispatched

optional
options: boolean | AddEventListenerOptions

event options EventTarget["addEventListener"]