Skip to main content
Version: v1

ISharedMap Interface

Shared map interface

Signature

export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any>

Extends: ISharedObject<ISharedMapEvents>, Map

Methods

MethodReturn TypeDescription
get(key)T | undefinedRetrieves the given key from the map.
set(key, value)thisSets the value stored at key to the provided value.

Method Details

get

Retrieves the given key from the map.

Signature

get<T = any>(key: string): T | undefined;
Type Parameters
ParameterDefaultDescription
Tany

Parameters

ParameterTypeDescription
keystringKey to retrieve from

Returns

The stored value, or undefined if the key is not set

Return type: T | undefined

set

Sets the value stored at key to the provided value.

Signature

set<T = any>(key: string, value: T): this;
Type Parameters
ParameterDefaultDescription
Tany

Parameters

ParameterTypeDescription
keystringKey to set at
valueTValue to set

Returns

The ISharedMap itself

Return type: this