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

Function remove

core/store.ts:293–309  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

291 return store.query(filter).first;
292 },
293 remove(id) {
294 db.utils.assertNotDestroyed("Cannot remove items");
295 const entity = itemsMap[id] ?? null;
296
297 if (entity === null) return false;
298
299 let didRemove = false;
300
301 runInAction(() => {
302 entity.cleanup.clean();
303 didRemove = items.remove(entity);
304 delete itemsMap[id];
305 removeEntityFromIndexes(entity);
306 });
307
308 return didRemove;
309 },
310 query(filter, sort) {
311 return createOrReuseQuery(filter, sort);
312 },

Callers

nothing calls this directly

Calls 3

removeEntityFromIndexesFunction · 0.85
assertNotDestroyedMethod · 0.80
removeMethod · 0.65

Tested by

no test coverage detected