Methods
emit
- emit<EventName>(eventName: EventName, event: E[EventName]): void
-
Type Parameters
-
EventName extends string | number | symbol
Parameters
-
eventName: EventName
-
event: E[EventName]
Returns void
off
- off<EventName>(eventName: EventName, handler: Handler<E[EventName]>): Emitter<E>
-
Type Parameters
-
EventName extends string | number | symbol
Parameters
-
eventName: EventName
-
handler: Handler<E[EventName]>
on
- on<EventName>(eventName: EventName, handler: Handler<E[EventName]>): Emitter<E>
-
Type Parameters
-
EventName extends string | number | symbol
Parameters
-
eventName: EventName
-
handler: Handler<E[EventName]>
A type-safe event emitter.