C
LwwRegister
testedLast-writer-wins register. A write applies only if its op id is later than the current write's (by {@link compareOpId}), so concurrent writes converge to the one with the higher timestamp regardless of arrival order.
Signature
ts
class LwwRegister<T>Type Parameters
TProperties
| Property | Type | Description |
|---|---|---|
timestampreadonly | OpId | null | — |
Methods
getts
get(): TReturns
TsetApply a timestamped write. Returns `true` if it won.
ts
set(value: T, id: OpId): boolean| Parameter | Type | Description |
|---|---|---|
value | T | — |
id | OpId | — |
Returns
boolean