Class TypedEventEmitter<T>
Methods
emit
- emit<K>(event, payload): boolean
Type Parameters
K extends string | number | symbol
Returns boolean
off
- off<K>(event, listener): this
Type Parameters
K extends string | number | symbol
Parameters
event: K
listener: ((payload) => void)
- (payload): void
Returns void
Returns this
on
- on<K>(event, listener): this
Type Parameters
K extends string | number | symbol
Parameters
event: K
listener: ((payload) => void)
- (payload): void
Returns void
Returns this
once
- once<K>(event, listener): this
Type Parameters
K extends string | number | symbol
Parameters
event: K
listener: ((payload) => void)
- (payload): void
Returns void
Returns this
subscribe
- subscribe<K>(event, listener): {
remove: (() => void);
} Type Parameters
K extends string | number | symbol
Parameters
event: K
listener: ((payload) => void)
- (payload): void
Returns void
Returns {
remove: (() => void);
}