-
Notifications
You must be signed in to change notification settings - Fork 2
Record CRDT
Jesse Gibson edited this page Dec 25, 2019
·
1 revision
Composes the Register into a structure of predefined fields enforced by the type system.
{
id: string,
fields: {
[string]: Register,
},
}
The merge function accepts another record, applying the merge function on each register for all fields.
Record IDs should always be prefixed with the number 1
.
The record exposes a single mutation: .update()
. For all fields, it calls .set(...)
on the corresponding register.
To produce a map delta, find all registers which report a change, adding them to a new map of the same ID. The product is the minimal delta.