R
C

LwwMap

tested

Last-writer-wins map with per-key timestamps and tombstones. Concurrent set/delete on a key converge to the operation with the higher op id.

Signature

ts
class LwwMap<K, V>

Type Parameters

K
V

Methods

set
ts
set(key: K, value: V, id: OpId): boolean
ParameterTypeDescription
keyK
valueV
idOpId
Returnsboolean
delete
ts
delete(key: K, id: OpId): boolean
ParameterTypeDescription
keyK
idOpId
Returnsboolean
get
ts
get(key: K): V | undefined
ParameterTypeDescription
keyK
ReturnsV | undefined
has
ts
has(key: K): boolean
ParameterTypeDescription
keyK
Returnsboolean
keys
ts
keys(): K[]
ReturnsK[]
toEntries
ts
toEntries(): Array<[K, V]>
Returns[K, V][]