Skip to main content
Version: v1.11.0

Class: Stage

A class impementing the Stages SDK

Hierarchy

  • TypedEmitter<StageEventMap>

    Stage

Constructors

constructor

new Stage(token, strategy)

Creates an instance of a Stage

Parameters

NameTypeDescription
tokenstringThe token to join this stage as
strategyStageStrategyThe StageStrategy to use for this Stage

Overrides

TypedEmitter<StageEventMap\>.constructor

Methods

emit

emit<E>(event, ...args): void

Emit args for event E

Type parameters

NameType
Eextends keyof StageEventMap

Parameters

NameTypeDescription
eventEthe event name
...argsParameters<StageEventMap[E]>-

Returns

void

Inherited from

TypedEmitter.emit


join

join(): Promise<void>

Joins the stage

Returns

Promise<void>


leave

leave(): void

Leaves the stage

Returns

void


off

off<E>(event, callback): void

De-register a callback for event E

Type parameters

NameType
Eextends keyof StageEventMap

Parameters

NameTypeDescription
eventEthe event to de-register the callback for
callbackStageEventMap[E]the callback to be de-registered

Returns

void

Inherited from

TypedEmitter.off


on

on<E>(event, callback): void

Register a new callback for event E

Type parameters

NameType
Eextends keyof StageEventMap

Parameters

NameTypeDescription
eventEthe event to register the callback for
callbackStageEventMap[E]the callback to be invoked for the event

Returns

void

Inherited from

TypedEmitter.on


refreshStrategy

refreshStrategy(): void

Re-executes the StageStrategy

Returns

void


removeAllListeners

removeAllListeners(): void

Remove all event listeners

Returns

void

Inherited from

TypedEmitter.removeAllListeners


replaceStrategy

replaceStrategy(strategy): void

Updates and re-executes the StageStrategy

Parameters

NameTypeDescription
strategyStageStrategyThe new StageStrategy for the stage

Returns

void