ORMapOptions
이 콘텐츠는 아직 번역되지 않았습니다.
ORMapOptions<
K> =object
Defined in: src/crdt/ORMap.ts:39
Observed-Remove map, where each value is itself a CRDT. Keys
follow OR-Set add-wins semantics; values merge per-key via their
own merge. The natural fit when you want a logical map and each
cell needs its own conflict-free type — e.g. carts where every
cart is itself an ORSet of items, or per-tenant options where
each tenant’s options is an LWWMap.
const empty = ORMap.empty<string, ORSet
Add-wins for keys. Concurrent put(key) | remove(key) resolves
via the underlying ORSet’s tag rules: the put carries a tag the
remove never saw, so it survives. See ORSet for the
formal mechanism.
Inner-CRDT decoder injection (fromJSON). Because the value
type is itself a CRDT, deserialisation needs to know which
CRDT to build for each value. Pass a decodeValue: (json) => V
callback to fromJSON; the DistributedData extension wires its
decodeCrdt dispatcher in for you. Standalone usage:
ORMap.fromJSON(json, (v) => ORSet.fromJSON
Element identity. Same JSON-stringify default + identity
override pattern as the rest of the map types — pass
{ identity: k => ... } for non-JSON-serialisable keys.
Type Parameters
Section titled “Type Parameters”K
Properties
Section titled “Properties”identity?
Section titled “identity?”
readonlyoptionalidentity?: (k) =>string
Defined in: src/crdt/ORMap.ts:40
Parameters
Section titled “Parameters”K
Returns
Section titled “Returns”string
