Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

inject-query-zone.ts

7 lines254 Bytes

1import { NgZone, inject } from '@angular/core'
2​
3/** Keep Query's background timers out of Angular's stability tracking. */
4export function injectQueryZone() {
5 const ngZone = inject(NgZone)
6 return <T>(fn: () => T): T => ngZone.runOutsideAngular(fn)
7}