MCPcopy Create free account
hub / github.com/clientdb/clientdb / removeChange

Function removeChange

core/transaction.ts:54–67  ·  view source on GitHub ↗
(changeToRemove: Change)

Source from the content-addressed store, hash-verified

52}
53
54function removeChange(changeToRemove: Change) {
55 const changes = getEntityChanges(changeToRemove.entity);
56
57 if (!changes) {
58 throw new Error("No registered changes");
59 }
60
61 if (!changes.has(changeToRemove)) {
62 console.warn("Did not delete");
63 return;
64 }
65
66 changes.delete(changeToRemove);
67}
68
69/**
70 * If we reject 'initial' change, while 'next' change is already pending, we need to tell 'next' change how to restore initial state of entity.

Callers 1

commitFunction · 0.85

Calls 1

getEntityChangesFunction · 0.85

Tested by

no test coverage detected