Type Parameters
- T extends Record<keyof T, unknown[]>
Constructors
constructor
- new EventDispatcher<T extends Record<keyof T, unknown[]>>(): EventDispatcher<T>
Type Parameters
- T extends Record<keyof T, unknown[]>
Methods
off
- off<K extends string | number | symbol>(
event: K,
listener: (this: undefined, ...args: T[K]) => void,
): void Type Parameters
- K extends string | number | symbol
Parameters
- event: K
- listener: (this: undefined, ...args: T[K]) => void
Returns void
on
- on<K extends string | number | symbol>(
event: K,
listener: (this: undefined, ...args: T[K]) => void,
priority?: number,
): void Type Parameters
- K extends string | number | symbol
Parameters
- event: K
- listener: (this: undefined, ...args: T[K]) => void
- priority: number = 0
Returns void
trigger
- trigger<K extends string | number | symbol>(event: K, ...args: T[K]): void
Type Parameters
- K extends string | number | symbol
Returns void
Intentionally very simple event emitter.