patchEntity method

void patchEntity(
  1. String type,
  2. String id,
  3. Map<String, Object?> patch
)

Merge UI-only fields into the patch layer.

Implementation

void patchEntity(String type, String id, Map<String, Object?> patch) {
  _write(() {
    _patches.putIfAbsent(type, () => {});
    final prev = _patches[type]![id] ?? {};
    _patches[type]![id] = {...prev, ...patch};
    _notifyEntity(type, id);
  });
}