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) | Beta | Constructs a new instance of the EventEmitterWithErrorHandlingclass | 
Methods
| Method | Alerts | Return Type | Description | 
|---|---|---|---|
| emit(event, args) | Beta | boolean | 
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
| Parameter | Type | Description | 
|---|---|---|
| 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
| Parameter | Type | Description | 
|---|---|---|
| event | EventEmitterEventType | |
| args | unknown[] | 
Returns
Return type: boolean