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

Function setupMutationCacheSubscription

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

Source from the content-addressed store, hash-verified

2274}
2275
2276const setupMutationCacheSubscription = () => {
2277 const { mutationCacheSubscriptions } = useDevtoolsSubscriptions()
2278 const mutationCache = createMemo(() => {
2279 const client = useQueryDevtoolsContext().client
2280 return client.getMutationCache()
2281 })
2282
2283 createEffect(() => {
2284 const cache = mutationCache()
2285 const schedule = createCoalescedSchedule()
2286 const unsubscribe = cache.subscribe((event) => {
2287 mutationCacheSubscriptions.notify(() => cache, event, schedule)
2288 })
2289 onCleanup(unsubscribe)
2290 })
2291}
2292
2293const createSubscribeToMutationCacheBatcher = <T,>(
2294 callback: (

Callers 1

ContentViewFunction · 0.85

Calls 6

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

Tested by

no test coverage detected