MCPcopy
hub / github.com/tinyplex/tinybase / resetPreStores

Function resetPreStores

src/queries/index.ts:204–220  ·  view source on GitHub ↗
(queryId: Id)

Source from the content-addressed store, hash-verified

202 );
203
204 const resetPreStores = (queryId: Id) => {
205 ifNotUndefined(
206 mapGet(preStoreListenerIds, queryId),
207 (queryPreStoreListenerIds) => {
208 mapForEach(queryPreStoreListenerIds, (preStore, listenerIds) =>
209 collForEach(listenerIds, (listenerId) =>
210 preStore.delListener(listenerId),
211 ),
212 );
213 collClear(queryPreStoreListenerIds);
214 },
215 );
216 arrayForEach(
217 [getResultStore(queryId), mapGet(preStores, queryId)],
218 (store) => store?.delTable(queryId),
219 );
220 };
221
222 const addSourceStoreListeners = (
223 sourceStore: Store,

Callers 2

setQueryDefinitionImplFunction · 0.70
delQueryDefinitionFunction · 0.70

Calls 8

mapGetFunction · 0.90
mapForEachFunction · 0.90
collForEachFunction · 0.90
collClearFunction · 0.90
arrayForEachFunction · 0.90
getResultStoreFunction · 0.70
delListenerMethod · 0.65
delTableMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…