C
OpLog
An append-only log of operations with a version vector for deduplication and delta computation. The op shape is domain-specific; the log only reads `id`.
Signature
ts
class OpLog<Op extends HasOpId>Type Parameters
Opextends HasOpIdProperties
| Property | Type | Description |
|---|---|---|
versionreadonly | VersionVector | — |
Methods
appendAppend an op unless already seen. Returns `true` if appended.
ts
append(op: Op): boolean| Parameter | Type | Description |
|---|---|---|
op | Op | — |
Returns
booleanhasts
has(id: OpId): boolean| Parameter | Type | Description |
|---|---|---|
id | OpId | — |
Returns
booleanallts
all(): readonly Op[]Returns
readonly Op[]deltaOps a remote replica (described by its version vector) hasn't seen.
ts
delta(remote: VersionVector): Op[]| Parameter | Type | Description |
|---|---|---|
remote | VersionVector | — |
Returns
Op[]