Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/higa/deno/dep.ts>EventEmitter

A package to interract with the Discord API coded by myself
Latest
class EventEmitter
import { EventEmitter } from "https://deno.land/x/higa@0.1.2/deno/dep.ts";

Strictly typed Event Emitter for Deno.

Constructors

new
EventEmitter(maxListeners?: number)

Properties

private
readonly
cache: Map<keyof T, EventListener<T>[]>
private
readonly
maxListeners

Methods

private
push(slot: keyof T, item: EventListener<T>)
private
toJSON()
private
toString()
emit(event: keyof T, ...args: any)

Synchronously calls each of the registered listeners (callbacks) in order.

off<Event extends keyof T>(event: Event, callback?: T[Event]): boolean

Removes listener(s) from targeted event. By default it gonna delete all listeners from particular event. You can delete specific listener by parsing it as second parameter. It gonna return boolean value depending on result.

on<Event extends keyof T>(event: Event, callback: T[Event])
once<Event extends keyof T>(event: Event, callback: T[Event])