C
LwwMap
testedLast-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
KVMethods
setts
set(key: K, value: V, id: OpId): boolean| Parameter | Type | Description |
|---|---|---|
key | K | — |
value | V | — |
id | OpId | — |
Returns
booleandeletets
delete(key: K, id: OpId): boolean| Parameter | Type | Description |
|---|---|---|
key | K | — |
id | OpId | — |
Returns
booleangetts
get(key: K): V | undefined| Parameter | Type | Description |
|---|---|---|
key | K | — |
Returns
V | undefinedhasts
has(key: K): boolean| Parameter | Type | Description |
|---|---|---|
key | K | — |
Returns
booleankeysts
keys(): K[]Returns
K[]toEntriests
toEntries(): Array<[K, V]>Returns
[K, V][]