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

List of constructors for this class
Constructor Modifiers Description
(constructor)(source) Constructs a new instance of the EventForwarder class

Properties

List of properties for this class
Property Modifiers Type Description
disposed boolean

Methods

List of methods on this class
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

List of 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

List of parameters
Parameter Type Description
source EventEmitter | IEventProvider
events string[]

Returns:

void

isEmitterEvent

Signature:

protected static isEmitterEvent(event: string): boolean;

Parameters

List of parameters
Parameter Type Description
event string

Returns:

boolean

unforwardEvent

Signature:

protected unforwardEvent(source: EventEmitter | IEventProvider<TEvent>, ...events: string[]): void;

Parameters

List of parameters
Parameter Type Description
source EventEmitter | IEventProvider
events string[]

Returns:

void