Interface BatchContextLiveMap<T>

A wrapper around the LiveMap object that enables batching operations inside a BatchCallback.

Type Parameters

Hierarchy

  • BatchContextLiveMap

Methods

Methods

  • Experimental

    Mirrors the get method and returns the value associated with a key in the map.

    Type Parameters

    • TKey extends string

    Parameters

    • key: TKey

      The key to retrieve the value for.

    Returns undefined | T[TKey]

    A LiveObject, a primitive type (string, number, boolean, or binary data) or undefined if the key doesn't exist in a map or the associated LiveObject has been deleted. Always undefined if this map object is deleted.

  • Experimental

    Similar to the remove method, but instead, it adds an operation to remove a key from the map to the current batch, to be sent in a single message to the Ably service.

    This does not modify the underlying data of this object. Instead, the change is applied when the published operation is echoed back to the client and applied to the object. To get notified when object gets updated, use the subscribe method.

    Type Parameters

    • TKey extends string

    Parameters

    • key: TKey

      The key to set the value for.

    Returns void

  • Experimental

    Similar to the set method, but instead, it adds an operation to set a key in the map with the provided value to the current batch, to be sent in a single message to the Ably service.

    This does not modify the underlying data of this object. Instead, the change is applied when the published operation is echoed back to the client and applied to the object. To get notified when object gets updated, use the subscribe method.

    Type Parameters

    • TKey extends string

    Parameters

    • key: TKey

      The key to set the value for.

    • value: T[TKey]

      The value to assign to the key.

    Returns void

  • Experimental

    Returns the number of key-value pairs in the map.

    Returns number

Generated using TypeDoc