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

x/aleph/framework/core/events.ts>EventEmitter.on

The Full-stack Framework in Deno.
Very Popular
Go to Latest
method EventEmitter.on
import { EventEmitter } from "https://deno.land/x/aleph@v0.3.0-alpha.32/framework/core/events.ts";

Returns an AsyncIterator that iterates eventName events. It will throw if the EventEmitter emits 'error'. It removes all listeners when exiting the loop. The value returned by each iteration is an array composed of the emitted event arguments.

Parameters

emitter: EventEmitter
event: string | symbol

Returns

AsyncIterable