Patch builder for the local changes.
Private
inReadonly
modelModel instance on which the API operates.
Readonly
onEmitted before local changes through model.api
are applied.
Readonly
onEmitted before a patch is applied using model.applyPatch()
.
Readonly
onEmitted before the model is reset, using the .reset()
method.
Readonly
onEmitted before a transaction is started.
Readonly
onEmitted when the model changes. Combines onReset
, onPatch
and onLocalChange
.
Readonly
onEmitted when the model changes. Same as .onChange
, but this event is emitted once per microtask.
Readonly
onEmitted when the model.api
builder change buffer is flushed.
Readonly
onEmitted after local changes through model.api
are applied.
Readonly
onEmitted after local changes through model.api
are applied. Same as
.onLocalChange
, but this event buffered withing a microtask.
Readonly
onEmitted after a patch is applied using model.applyPatch()
.
Readonly
onEmitted after the model is reset, using the .reset()
method.
Readonly
onEmitted after transaction completes.
Optional
stopLocates an arr
node and returns a local changes API for it. If the node
doesn't exist or the node at the path is not an arr
node, throws an error.
Optional
path: ApiPathPath at which to locate a node.
A local changes API for an arr
node.
Begins to automatically flush buffered operations into patches, grouping
operations by microtasks or by transactions. To capture the patch, listen
to the .onFlush
event.
Callback to stop auto flushing.
Locates a con
node and returns a local changes API for it. If the node
doesn't exist or the node at the path is not a con
node, throws an error.
Optional
path: ApiPathPath at which to locate a node.
A local changes API for a con
node.
Rename to con
.
Readonly
getLocates an obj
node and returns a local changes API for it. If the node
doesn't exist or the node at the path is not an obj
node, throws an error.
Optional
path: ApiPathPath at which to locate a node.
A local changes API for an obj
node.
Readonly
subscribeLocates a val
node and returns a local changes API for it. If the node
doesn't exist or the node at the path is not a val
node, throws an error.
Optional
path: ApiPathPath at which to locate a node.
A local changes API for a val
node.
Locates a vec
node and returns a local changes API for it. If the node
doesn't exist or the node at the path is not a vec
node, throws an error.
Optional
path: ApiPathPath at which to locate a node.
A local changes API for a vec
node.
Returns the view of the model.
JSON/CBOR of the model.
Returns a local change API for the given node. If an instance already exists, returns the existing instance.
Local changes API for a JSON CRDT model. This class is the main entry point for executing local user actions on a JSON CRDT document.