Skip to main content
Version: v1

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

ParameterConstraintDefaultDescription
TEventIEventIEvent

Constructors

ConstructorDescription
(constructor)(errorHandler)Constructs a new instance of the EventEmitterWithErrorHandling class

Methods

MethodReturn TypeDescription
emit(event, args)boolean

Constructor Details

(constructor)

Constructs a new instance of the EventEmitterWithErrorHandling class

Signature

constructor(errorHandler: (eventName: EventEmitterEventType, error: any) => void);

Parameters

ParameterTypeDescription
errorHandler(eventName: EventEmitterEventType, error: any) => void

Method Details

emit

Signature

emit(event: EventEmitterEventType, ...args: any[]): boolean;

Parameters

ParameterTypeDescription
eventEventEmitterEventType
argsany[]

Returns

Return type: boolean