EventEmitterWithErrorHandling Class
Event Emitter helper class Any exceptions thrown by listeners will be caught and raised through "error" event. Any exception thrown by "error" listeners will propagate to the caller.
Signature
export declare class EventEmitterWithErrorHandling<TEvent extends IEvent = IEvent> extends TypedEventEmitter<TEvent>
Extends: TypedEventEmitter
Type Parameters
Parameter | Constraint | Default | Description |
---|---|---|---|
TEvent | IEvent | IEvent |
Constructors
Constructor | Description |
---|---|
(constructor)(errorHandler) | Constructs a new instance of the EventEmitterWithErrorHandling class |
Methods
Method | Return Type | Description |
---|---|---|
emit(event, args) | boolean |
Constructor Details
(constructor)
Constructs a new instance of the EventEmitterWithErrorHandling
class
Signature
constructor(errorHandler: (eventName: EventEmitterEventType, error: any) => void);
Parameters
Parameter | Type | Description |
---|---|---|
errorHandler | (eventName: EventEmitterEventType, error: any) => void |
Method Details
emit
Signature
emit(event: EventEmitterEventType, ...args: any[]): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
event | EventEmitterEventType | |
args | any[] |
Returns
Return type: boolean