Interface BatchContextAnyOperations

Defines all possible operations available on BatchContext objects.

Hierarchy

Methods

  • An alias for calling increment(-amount)

    Parameters

    • Optional amount: number

      The amount by which to decrease the counter value. If not provided, defaults to 1.

    Returns void

  • Adds an operation to the current batch to increment the value of the underlying LiveCounterInstance. All queued operations are sent together in a single message once the batch function completes.

    If the underlying instance at runtime is not a counter, this method throws an error.

    This does not modify the underlying data of the counter. 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 PathObject.subscribe or Instance.subscribe, as appropriate.

    Parameters

    • Optional amount: number

      The amount by which to increase the counter value. If not provided, defaults to 1.

    Returns void

  • Adds an operation to the current batch to remove a key from the underlying LiveMapInstance. All queued operations are sent together in a single message once the batch function completes.

    If the underlying instance at runtime is not a map, this method throws an error.

    This does not modify the underlying data of the map. 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 PathObject.subscribe or Instance.subscribe, as appropriate.

    Type Parameters

    • T extends Record<string, Value> = Record<string, Value>

    Parameters

    • key: keyof T & string

      The key to remove.

    Returns void

  • Adds an operation to the current batch to set a key to a specified value on the underlying LiveMapInstance. All queued operations are sent together in a single message once the batch function completes.

    If the underlying instance at runtime is not a map, this method throws an error.

    This does not modify the underlying data of the map. 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 PathObject.subscribe or Instance.subscribe, as appropriate.

    Type Parameters

    • T extends Record<string, Value> = Record<string, Value>

    Parameters

    • key: keyof T & string

      The key to set the value for.

    • value: T[keyof T]

      The value to assign to the key.

    Returns void

Generated using TypeDoc