Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CrdtMap

A map with embedded CRDTs. Each map implements the CrdtFactory interface, so it can be used like a connection to create references to embedded objects. The remove and removeAll methods can be used to remove entries from the map.

Example:

let map = connection.map("my-map2");
await connection.update([
    map.register("a").set("x"),
    map.register("b").set("x"),
    map.register("c").set("x"),
    map.register("d").set("x"),
    map.set("e").addAll([1, 2, 3, 4]),
    map.counter("f").increment(5)
])
await connection.update([
    map.remove(map.register("a")),
    map.removeAll([map.register("b"), map.register("c")])
])
let val = await map.read();
// convert CrdtMapValue to JavaScript object:
let obj = val.toJsObject();
// obj is now { d: "x", e: [1, 2, 3, 4], f: 5 }

Hierarchy

Implemented by

Index

Properties

parent

parent: CrdtFactory

the parent factory

Methods

counter

fatCounter

flag_dw

flag_ew

gmap

multiValueRegister

read

register

remove

removeAll

rrmap

set

set_removeWins

  • set_removeWins<T>(key: string): CrdtSet<T>

Generated using TypeDoc