removeOptimisticPatch method

void removeOptimisticPatch(
  1. String removeId
)

Remove a given patch from the list

This will also remove all "nested" patches, such as $queryId.update (see recordOptimisticTransaction)

This allows for hierarchical optimism that is automatically cleaned up without having to tightly couple optimistic changes

Implementation

void removeOptimisticPatch(String removeId) {
  optimisticPatches.removeWhere(
    (patch) => patch.id == removeId || _parentPatchId(patch.id) == removeId,
  );
  broadcastRequested = true;
}