TurnContextStateCollection class

Values persisted for the lifetime of the turn as part of the TurnContext.

Extends

any

Remarks

Typical values stored here are objects which are needed for the lifetime of a turn, such as Storage, BotState, ConversationState, LanguageGenerator, ResourceExplorer, etc.

Methods

get(any)

Gets a value from the TurnContextStateCollection.

get<T>(any)

Gets a typed value from the TurnContextStateCollection.

pop(any)

Restores a keys previous value, and returns the value that was removed.

push(any, any)

Push a value by key to the turn's context.

Method Details

get(any)

Gets a value from the TurnContextStateCollection.

function get(key: any): any

Parameters

key

any

The values key.

Returns

any

get<T>(any)

Gets a typed value from the TurnContextStateCollection.

function get<T>(key: any): T

Parameters

key

any

The values key.

Returns

T

pop(any)

Restores a keys previous value, and returns the value that was removed.

function pop(key: any): any

Parameters

key

any

The values key.

Returns

any

The removed value.

push(any, any)

Push a value by key to the turn's context.

function push(key: any, value: any)

Parameters

key

any

The values key.

value

any

The new value.

Remarks

The keys current value (if any) will be saved and can be restored by calling pop().