Interface BatchContextLiveCounter

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

Hierarchy

  • BatchContextLiveCounter

Methods

  • Experimental

    Similar to the increment method, but instead, it adds an operation to increment the counter 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.

    Parameters

    • amount: number

      The amount by which to increase the counter value.

    Returns void

  • Experimental

    Returns the current value of the counter.

    Returns number

Generated using TypeDoc