Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/mutevents/mod.ts>EventEmitter#emit

Typed, async, and promiseable events for Deno
Latest
method EventEmitter.prototype.emit
import { EventEmitter } from "https://deno.land/x/mutevents@5.4.1/mod.ts";

Asynchronously emits the given data on the given event type

Type Parameters

K extends keyof T

Parameters

type: K

Event type

data: T[K]

Event data

Returns

Promise<EventResult<T, K>>

Event result with modified (or not) data, and a cancelled object if cancelled