import { default } from "https://deno.land/x/evtemitter@v3.1.0/EventEmitter.ts";
add a callback to an event
Type Parameters
Ev extends ReservedOrUserEventNames<ReservedEvents, UserEvents>
Parameters
type: Ev
the event name the callback should listen to
callback: ReservedOrUserListenerOn<ReservedEvents, UserEvents, Ev>
the callback to execute when the event is dispatched
optional
options: boolean | AddEventListenerOptionsevent options EventTarget["addEventListener"]
add a callback to multiple events
Type Parameters
Ev extends ReservedOrUserEventNames<ReservedEvents, UserEvents>
Parameters
types: Ev[]
an array of the event names the callback should listen to
callback: ReservedOrUserListenerOn<ReservedEvents, UserEvents, Ev>
the callback to execute when the event is dispatched
optional
options: boolean | AddEventListenerOptionsevent options EventTarget["addEventListener"]