MCPcopy Create free account
hub / github.com/TanStack/query / setupQueryCacheSubscription

Function setupQueryCacheSubscription

packages/query-devtools/src/Devtools.tsx:2231–2246  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2229}
2230
2231const setupQueryCacheSubscription = () => {
2232 const { queryCacheSubscriptions } = useDevtoolsSubscriptions()
2233 const queryCache = createMemo(() => {
2234 const client = useQueryDevtoolsContext().client
2235 return client.getQueryCache()
2236 })
2237
2238 createEffect(() => {
2239 const cache = queryCache()
2240 const schedule = createCoalescedSchedule()
2241 const unsubscribe = cache.subscribe((event) => {
2242 queryCacheSubscriptions.notify(() => cache, event, schedule)
2243 })
2244 onCleanup(unsubscribe)
2245 })
2246}
2247
2248const createSubscribeToQueryCacheBatcher = <T,>(
2249 callback: (

Callers 1

ContentViewFunction · 0.85

Calls 6

useDevtoolsSubscriptionsFunction · 0.90
useQueryDevtoolsContextFunction · 0.90
createCoalescedScheduleFunction · 0.85
getQueryCacheMethod · 0.80
subscribeMethod · 0.45
notifyMethod · 0.45

Tested by

no test coverage detected