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

Function removeItemFromIndex

core/queryIndex.ts:139–153  ·  view source on GitHub ↗
(entity: TargetEntity)

Source from the content-addressed store, hash-verified

137 }
138
139 function removeItemFromIndex(entity: TargetEntity) {
140 const currentIndexList = currentItemIndexMap.get(entity);
141
142 if (!currentIndexList) {
143 console.warn(
144 "bad state - trying to remove item from index, but item is not in any index"
145 );
146 return;
147 }
148
149 runInAction(() => {
150 currentIndexList.remove(entity);
151 currentItemIndexMap.delete(entity);
152 });
153 }
154
155 /**
156 * There are 2 ways of indexing - it depends on 'key' being used.

Callers 2

handleRemoveRequestFunction · 0.85

Calls 1

removeMethod · 0.65

Tested by

no test coverage detected