Capítulo 60 de 80
notifyManager batches and schedules internal update notifications — its main external hook is setBatchNotifyFunction, the way non-React framework adapters (e.g. solid-query calling SolidJS's batch) tell TanStack Query how to batch re-renders for their own reactivity system.
batch(callback): runs callback, batching every update scheduled inside it — mainly internal, used to coalesce QueryClient updates.batchCalls(callback): wraps a callback so every invocation schedules it to run on the next batch instead of immediately.schedule(callback): queues a callback for the next batch — runs via setTimeout by default, configurable through setScheduler.setNotifyFunction(fn): overrides how an individual notification is delivered — e.g. wrapping calls in React's act() during tests.setBatchNotifyFunction(fn): the framework-integration hook — tells the library to use a specific batching function (e.g. solid-js's batch) instead of its own default, so updates coalesce correctly within that framework's reactivity model.setScheduler(fn): replaces when the next batch runs — default is setTimeout(cb, 0); alternatives include queueMicrotask (next microtask) or requestAnimationFrame (before next paint).// Framework-adapter batching integration (as solid-query does)
import { batch } from 'solid-js'
notifyManager.setBatchNotifyFunction(batch)
// Test-friendly notification wrapping
notifyManager.setNotifyFunction(act)
setBatchNotifyFunction is the integration point a new framework adapter needs to implement correctly, not batch/batchCalls/schedule directly.setNotifyFunction(act) for wrapping test-time notifications.