Skip to main content
Module

x/net/mod.ts>EventEmitter

A networking framework that aims to enable the development of complex multi-port servers and clients.
Go to Latest
class EventEmitter
Re-export
import { EventEmitter } from "https://deno.land/x/net@v1.0.0/mod.ts";

Event emitter

Properties

private
listeners: Map<string, ((...args: any) => void)[]>

Methods

emit(event: string, ...data: any[])

Emits an event

off(event: string, fn: (...args: any) => void)

Removes a listener from the event

on(event: string, fn: (...args: any) => void)

Adds a listener to the event

once(event: string, fn: (...args: any) => void)

Adds a one-time listener to the event