import { EventEmitter } from "https://deno.land/x/tui@1.3.4/src/event_emitter.ts";
Custom implementation of event emitter
Type Parameters
EventMap extends EventRecord
Properties
listeners: [key in keyof EventMap]?: EventListener<EventMap, key>[]
Methods
Emit specific type, after emitting all listeners associated with that event type will run with given arguments
off(): void
Remove event listeners
- If no event type is passed, every single listener will be removed
- If just type is passed with no listener, every listener for specific type will be removed
- If both type and listener is passed, just this specific listener will be removed
off<Type extends keyof EventMap>(type: Type, listener: EventListener<EventMap, Type>): void