MCPcopy Create free account
hub / github.com/TanStack/db / updateCacheData

Function updateCacheData

packages/query-db-collection/src/query.ts:1837–1849  ·  view source on GitHub ↗
(items: Array<any>)

Source from the content-addressed store, hash-verified

1835 * the current syncedData state.
1836 */
1837 const updateCacheData = (items: Array<any>): void => {
1838 const allCached = queryClient.getQueryCache().findAll({ queryKey: baseKey })
1839
1840 if (allCached.length > 0) {
1841 for (const query of allCached) {
1842 updateCacheDataForKey(query.queryKey, items)
1843 }
1844 } else {
1845 // Fallback: no queries in cache yet, seed the base query key.
1846 // This handles the case where updateCacheData is called before any queries are created.
1847 updateCacheDataForKey(baseKey, items)
1848 }
1849 }
1850
1851 // Create write context for manual write operations
1852 let writeContext: {

Callers

nothing calls this directly

Calls 1

updateCacheDataForKeyFunction · 0.85

Tested by

no test coverage detected