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

ParameterConstraintDefaultDescription
TEventIEventIEvent

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

ConstructorAlertsDescription
(constructor)(errorHandler)BetaConstructs a new instance of the EventEmitterWithErrorHandling class

Methods

MethodAlertsReturn TypeDescription
emit(event, args)Betaboolean

Constructor Details

(constructor)

Constructs a new instance of the EventEmitterWithErrorHandling class

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

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

Signature

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

Parameters

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

Method Details

emit

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

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

Signature

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

Parameters

ParameterTypeDescription
eventEventEmitterEventType
argsunknown[]

Returns

Return type: boolean