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

Method Return Type Description
get(key) T | undefined Retrieves the given key from the map.
set(key, value) this Sets 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
Parameter Default Description
T any

Parameters

Parameter Type Description
key string Key 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
Parameter Default Description
T any

Parameters

Parameter Type Description
key string Key to set at
value T Value to set

Returns

The ISharedMap itself

Return type: this