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