Experimental
An alias for calling LiveCounter.increment(-amount)
The amount by which to decrease the counter value.
A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.
Experimental
Sends an operation to the Ably system to increment the value of this LiveCounter
object.
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.
The amount by which to increase the counter value.
A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.
Experimental
Removes all registrations that match both the specified listener and the specified event.
The named event.
The event listener.
Experimental
Registers the provided listener for the specified event. If on()
is called more than once with the same listener and event, the listener is added multiple times to its listener registry. Therefore, as an example, assuming the same listener is registered twice using on()
, and an event is emitted once, the listener would be invoked twice.
The named event to listen for.
The event listener.
A OnLiveObjectLifecycleEventResponse object that allows the provided listener to be deregistered from future updates.
Experimental
Registers a listener that is called each time this LiveObject is updated.
An event listener function that is called with an update object whenever this LiveObject is updated.
A SubscribeResponse object that allows the provided listener to be deregistered from future updates.
Experimental
Deregisters the given listener from updates for this LiveObject.
An event listener function.
Generated using TypeDoc
The
LiveCounter
class represents a counter that can be incremented or decremented and is synchronized across clients in realtime.