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

x/yxz/index.ts>async.EventEmitter#on

Deno Standard Extensions
Go to Latest
method async.EventEmitter.prototype.on
import { async } from "https://deno.land/x/yxz@0.17.0/index.ts";
const { EventEmitter } = async;

Register an event listener for event type.

Type Parameters

T extends keyof Events

Parameters

type: T

Event type

listener: EventListener<Events>

Callback

Type Parameters

T extends keyof Events

Parameters

type: "*"
listener: WildcardListener<Events>

Type Parameters

T extends keyof Events

Parameters

type: T
listener: EventListener<Events> | WildcardListener<Events>