Type Parameters
T extends Record<string | symbol, any>
Constructors
constructor
- new EventEmitter<T>(): EventEmitter<T>
Type Parameters
T extends Record<string | symbol, any>
Properties
Private
eventMap
eventMap: eventMap<T> = ... Methods
emit
- emit<K>(eventName, ...args): boolean
Type Parameters
K extends string | number | symbol
Parameters
eventName: K
Rest
...args: Parameters<T[K]>
Returns boolean
off
- off<K>(eventName, listener): this
Type Parameters
K extends string | number | symbol
Parameters
eventName: K
listener: T[K]
Returns this
on
- on<K>(eventName, listener): this
Type Parameters
K extends string | number | symbol
Parameters
eventName: K
listener: T[K]
Returns this
once
- once<K>(eventName, listener): this
Type Parameters
K extends string | number | symbol
Parameters
eventName: K
listener: T[K]
Returns this
触发事件