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

x/pup/lib/common/eventemitter.ts>EventEmitter

Universal process manager built in Deno
Go to Latest
class EventEmitter
import { EventEmitter } from "https://deno.land/x/pup@1.0.0-beta.8/lib/common/eventemitter.ts";

Properties

listeners: Map<string, Array<EventHandler<any>>>

Methods

emit<T>(event: string, eventData?: T)

Emits an event, calling all registered event listeners for the specified event.

off<T>(event: string, fn: EventHandler<T>)

Removes an event listener for the specified event.

on<T>(event: string, fn: EventHandler<T>)

Registers an event listener for the specified event.