listen
Adds a (permanent) event listener.
listen(handler: (this: unknown, event: TEvent) => void | Promise<void>): void listen(): AsyncIterable<TEvent>
Parameters
- handler — A function that will be called for every event that’s emitted, with the event as the only argument; if not provided, this method returns an async iterable (see ManagedObject.listen()
Related
- class GlobalEmitterAn object that’s used for emitting events.