Open History to see the last commit
1import { NgZone, inject } from '@angular/core'
2β
3/**
4 * Keeps Query's background timers out of Angular's stability tracking.
5 * @returns A function that runs callbacks outside the injected NgZone.
6 */
7export function injectQueryZone() {
8 const ngZone = inject(NgZone)
9 return <T>(fn: () => T): T => ngZone.runOutsideAngular(fn)
10}