EventForwarder Class
Packages > @fluidframework/common-utils > EventForwarder
Base class used for forwarding events from a source EventEmitter. This can be useful when all arbitrary listeners need to be removed, but the primary source needs to stay intact.
Signature:
export declare class EventForwarder<TEvent extends IEvent = IEvent> extends TypedEventEmitter<TEvent> implements IDisposable
Extends: TypedEventEmitter<TEvent>
Implements: IDisposable
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(source) | Constructs a new instance of the EventForwarder class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
disposed | boolean |
Methods
Method | Modifiers | Description |
---|---|---|
dispose() | ||
forwardEvent(source, events) | ||
isEmitterEvent(event) | static |
|
unforwardEvent(source, events) |
Constructors
EventForwarder.(constructor)
Constructs a new instance of the EventForwarder
class
Signature:
constructor(source?: EventEmitter | IEventProvider<TEvent>);
Parameters
Parameter | Type | Description |
---|---|---|
source | EventEmitter | IEventProvider |
Properties
disposed
Signature:
get disposed(): boolean;
Methods
dispose
Signature:
dispose(): void;
Returns:
void
forwardEvent
Signature:
protected forwardEvent(source: EventEmitter | IEventProvider<TEvent>, ...events: string[]): void;
Parameters
Parameter | Type | Description |
---|---|---|
source | EventEmitter | IEventProvider |
|
events | string[] |
Returns:
void
isEmitterEvent
Signature:
protected static isEmitterEvent(event: string): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
event | string |
Returns:
boolean
unforwardEvent
Signature:
protected unforwardEvent(source: EventEmitter | IEventProvider<TEvent>, ...events: string[]): void;
Parameters
Parameter | Type | Description |
---|---|---|
source | EventEmitter | IEventProvider |
|
events | string[] |
Returns:
void