Readonly id
Get the object ID of the underlying instance.
If the underlying instance at runtime is not a LiveObject, returns undefined.
Get an in-memory JavaScript object representation of the map instance.
Cyclic references are handled through memoization, returning shared compacted
object references for previously visited objects. This means the value returned
from compact() cannot be directly JSON-stringified if the object may contain cycles.
If the underlying instance's value is not of the expected type at runtime, returns undefined.
Use compactJson() for a JSON-serializable representation.
Get a JSON-serializable representation of the map instance.
Binary values are converted to base64-encoded strings.
Cyclic references are represented as { objectId: string } instead of in-memory pointers,
making the result safe to pass to JSON.stringify().
If the underlying instance's value is not of the expected type at runtime, returns undefined.
Use compact() for an in-memory representation.
Returns an iterable of key-value pairs for each entry in the map. Each value is represented as a BatchContext corresponding to its key.
If the underlying instance at runtime is not a map, returns an empty iterator.
Returns the value associated with a given key as a BatchContext.
Returns undefined if the key doesn't exist in the map, if the referenced LiveObject has been deleted,
or if this map object itself has been deleted.
The key to retrieve the value for.
A BatchContext representing a LiveObject, a primitive type (string, number, boolean, JSON-serializable object or array, or binary data) or undefined if the key doesn't exist in a map or the referenced LiveObject has been deleted. Always undefined if this map object is deleted.
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.
The key to remove.
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.
The key to set the value for.
The value to assign to the key.
Returns an iterable of values in the map. Each value is represented as a BatchContext.
If the underlying instance at runtime is not a map, returns an empty iterator.
Generated using TypeDoc
LiveMapBatchContext is a batch context wrapper for a LiveMap object. The type parameter T describes the expected structure of the map's entries.