applyChanges method

void applyChanges(
  1. MapDiffs<K, V> changes
)

Implementation

void applyChanges(MapDiffs<K, V> changes) {
  for (final change in changes) {
    switch (change.type) {
      case MapDiffType.set:
        if (change.value == null) {
          super.remove(change.key);
        } else {
          super[change.key] = change.value!;
        }
        break;
      case MapDiffType.unset:
        super.remove(change.key);
        break;
      case MapDiffType.change:
        //ericm I felt like we should be removing when null, not setting to null

        if (change.value == null) {
          super.remove(change.key);
        } else {
          super[change.key] = change.value!;
        }
        break;
    }
  }
  changeController.add(changes);
}