Skip to main content

EventEmitterWithErrorHandling Class

Event Emitter helper class

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/telemetry-utils/legacy.

For more information about our API support guarantees, see here.

Signature

export declare class EventEmitterWithErrorHandling<TEvent extends IEvent = IEvent> extends TypedEventEmitter<TEvent>

Extends: TypedEventEmitter<TEvent>

Type Parameters

Parameter Constraint Default Description
TEvent IEvent IEvent

Remarks

Any exceptions thrown by listeners will be caught and raised through "error" event. Any exception thrown by "error" listeners will propagate to the caller.

Constructors

Constructor Alerts Description
(constructor)(errorHandler) Alpha Constructs a new instance of the EventEmitterWithErrorHandling class

Constructor Details

(constructor)

Constructs a new instance of the EventEmitterWithErrorHandling class

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/telemetry-utils/alpha.

For more information about our API support guarantees, see here.

Signature

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

Parameters

Parameter Type Description
errorHandler (eventName: EventEmitterEventType, error: any) => void