Skip to main content

Interface: MutableSubscribableMap<K, V>

Defined in: src/sdk/sub/SubscribableMap.ts:77

A subscribable map which can accept inputs to add or remove key-value pairs.

Extends​

Type Parameters​

Type Parameter
K
V

Properties​

isMutableSubscribableMap​

readonly isMutableSubscribableMap: true

Defined in: src/sdk/sub/SubscribableMap.ts:79

Flags this object as a MutableSubscribableMap.


isSubscribableMap​

readonly isSubscribableMap: true

Defined in: src/sdk/sub/SubscribableMap.ts:27

Flags this object as a SubscribableMap.

Inherited from​

SubscribableMap.isSubscribableMap


size​

readonly size: number

Defined in: src/sdk/sub/SubscribableMap.ts:30

The number of elements contained in this map.

Inherited from​

SubscribableMap.size

Methods​

clear()​

clear(): void

Defined in: src/sdk/sub/SubscribableMap.ts:100

Removes all key-value pairs from this map.

Returns​

void


delete()​

delete(key): boolean

Defined in: src/sdk/sub/SubscribableMap.ts:95

Removes a key-value pair from this map.

Parameters​

ParameterTypeDescription
keyKThe key to remove.

Returns​

boolean

Whether the key-value pair was removed.


get()​

get(): ReadonlyMap<K, V>

Defined in: src/sdk/sub/SubscribableMap.ts:36

Gets a read-only version of this map.

Returns​

ReadonlyMap<K, V>

A read-only version of this map.

Inherited from​

SubscribableMap.get


getValue()​

getValue(key): undefined | V

Defined in: src/sdk/sub/SubscribableMap.ts:51

Gets the value stored under a given key in this map.

Parameters​

ParameterTypeDescription
keyKThe key under which the value to get is stored.

Returns​

undefined | V

The value stored under the specified key in this map, or undefined if this map does not contain the specified key.

Inherited from​

SubscribableMap.getValue


has()​

has(key): boolean

Defined in: src/sdk/sub/SubscribableMap.ts:43

Checks whether this map contains a key.

Parameters​

ParameterTypeDescription
keyKThe key to check.

Returns​

boolean

Whether this map contains the specified key.

Inherited from​

SubscribableMap.has


pipe()​

pipe(to, paused?): Subscription

Defined in: src/sdk/sub/SubscribableMap.ts:71

Subscribes to and pipes this map's state to a mutable subscribable map. Whenever a key-value pair added, changed, or removed event is received through the subscription, the same key-value pair will be added to, changed, or removed from the other map.

Parameters​

ParameterTypeDescription
toMutableSubscribableMap<K, V>The mutable subscribable map to which to pipe this map's state.
paused?booleanWhether the new subscription should be initialized as paused. Defaults to false.

Returns​

Subscription

The new subscription.

Inherited from​

SubscribableMap.pipe


setValue()​

setValue(key, value): this

Defined in: src/sdk/sub/SubscribableMap.ts:88

Adds a key-value pair to this map. If this map already contains the specified key, then the existing value stored under the key will be replaced with the new value.

Parameters​

ParameterTypeDescription
keyKThe key to add.
valueVThe value to add.

Returns​

this

This map, after the key-value pair has been added.


sub()​

sub(handler, initialNotify?, paused?): Subscription

Defined in: src/sdk/sub/SubscribableMap.ts:61

Subscribes to changes in this map's state.

Parameters​

ParameterTypeDescription
handlerSubscribableMapHandler<K, V>A function which is called when this map's state changes.
initialNotify?booleanWhether to immediately invoke the callback function with this map's current state. Defaults to false. This argument is ignored if the subscription is initialized as paused.
paused?booleanWhether the new subscription should be initialized as paused. Defaults to false.

Returns​

Subscription

The new subscription.

Inherited from​

SubscribableMap.sub