R
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 HasOpId

Properties

PropertyTypeDescription
versionreadonlyVersionVector

Methods

append

Append an op unless already seen. Returns `true` if appended.

ts
append(op: Op): boolean
ParameterTypeDescription
opOp
Returnsboolean
has
ts
has(id: OpId): boolean
ParameterTypeDescription
idOpId
Returnsboolean
all
ts
all(): readonly Op[]
Returnsreadonly Op[]
delta

Ops a remote replica (described by its version vector) hasn't seen.

ts
delta(remote: VersionVector): Op[]
ParameterTypeDescription
remoteVersionVector
ReturnsOp[]