MCPcopy Index your code
hub / github.com/TanStack/db / refetch

Function refetch

packages/query-db-collection/src/query.ts:1751–1761  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

1749 * @returns Promise that resolves when the refetch is complete, with QueryObserverResult
1750 */
1751 const refetch: RefetchFn = async (opts) => {
1752 const allQueryKeys = [...hashToQueryKey.values()]
1753 const refetchPromises = allQueryKeys.map((qKey) => {
1754 const queryObserver = state.observers.get(hashKey(qKey))!
1755 return queryObserver.refetch({
1756 throwOnError: opts?.throwOnError,
1757 })
1758 })
1759
1760 return Promise.all(refetchPromises)
1761 }
1762
1763 /**
1764 * Updates a single query key in the cache with new items, handling both direct arrays

Callers 1

queryCollectionOptionsFunction · 0.85

Calls 3

valuesMethod · 0.45
mapMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected