putAll method

void putAll(
  1. Map<K, V?> values
)

Inserts or updates all values in the CRDT and increments the canonical time accordingly.

Implementation

void putAll(Map<K, V?> values) {
  // Avoid touching the canonical time if no data is inserted
  if (values.isEmpty) return;

  _canonicalTime = Hlc.send(_canonicalTime);
  final records = values.map<K, Record<V>>((key, value) =>
      MapEntry(key, Record(_canonicalTime, value, _canonicalTime)));
  putRecords(records);
}