@tanstack/angular-query-experimental 5.73.3 → 5.74.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.mjs CHANGED
@@ -18,15 +18,20 @@ function infiniteQueryOptions(options) {
18
18
 
19
19
  // src/inject-infinite-query.ts
20
20
  import { InfiniteQueryObserver } from "@tanstack/query-core";
21
+ import {
22
+ Injector as Injector2,
23
+ assertInInjectionContext as assertInInjectionContext2,
24
+ inject as inject3,
25
+ runInInjectionContext
26
+ } from "@angular/core";
21
27
 
22
28
  // src/create-base-query.ts
23
29
  import {
24
- DestroyRef,
25
30
  NgZone,
26
31
  VERSION,
27
- computed as computed2,
32
+ computed as computed3,
28
33
  effect,
29
- inject,
34
+ inject as inject2,
30
35
  signal,
31
36
  untracked as untracked2
32
37
  } from "@angular/core";
@@ -69,23 +74,48 @@ function shouldThrowError(throwError, params) {
69
74
  function noop() {
70
75
  }
71
76
 
77
+ // src/inject-is-restoring.ts
78
+ import {
79
+ InjectionToken,
80
+ Injector,
81
+ assertInInjectionContext,
82
+ computed as computed2,
83
+ inject
84
+ } from "@angular/core";
85
+ var IS_RESTORING = new InjectionToken("");
86
+ function injectIsRestoring(options) {
87
+ !options?.injector && assertInInjectionContext(injectIsRestoring);
88
+ const injector = options?.injector ?? inject(Injector);
89
+ return injector.get(
90
+ IS_RESTORING,
91
+ computed2(() => false),
92
+ { optional: true }
93
+ );
94
+ }
95
+ function provideIsRestoring(isRestoring) {
96
+ return {
97
+ provide: IS_RESTORING,
98
+ useValue: isRestoring
99
+ };
100
+ }
101
+
72
102
  // src/create-base-query.ts
73
103
  function createBaseQuery(optionsFn, Observer) {
74
- const ngZone = inject(NgZone);
75
- const destroyRef = inject(DestroyRef);
76
- const queryClient = inject(QueryClient);
77
- const defaultedOptionsSignal = computed2(() => {
104
+ const ngZone = inject2(NgZone);
105
+ const queryClient = inject2(QueryClient);
106
+ const isRestoring = injectIsRestoring();
107
+ const defaultedOptionsSignal = computed3(() => {
78
108
  const defaultedOptions = queryClient.defaultQueryOptions(optionsFn());
79
- defaultedOptions._optimisticResults = "optimistic";
109
+ defaultedOptions._optimisticResults = isRestoring() ? "isRestoring" : "optimistic";
80
110
  return defaultedOptions;
81
111
  });
82
112
  const observerSignal = (() => {
83
113
  let instance = null;
84
- return computed2(() => {
114
+ return computed3(() => {
85
115
  return instance ||= new Observer(queryClient, defaultedOptionsSignal());
86
116
  });
87
117
  })();
88
- const optimisticResultSignal = computed2(
118
+ const optimisticResultSignal = computed3(
89
119
  () => observerSignal().getOptimisticResult(defaultedOptionsSignal())
90
120
  );
91
121
  const resultFromSubscriberSignal = signal(null);
@@ -106,15 +136,14 @@ function createBaseQuery(optionsFn, Observer) {
106
136
  allowSignalWrites: VERSION.major < "19" || void 0
107
137
  }
108
138
  );
109
- effect(() => {
139
+ effect((onCleanup) => {
110
140
  const observer = observerSignal();
111
- untracked2(() => {
112
- const unsubscribe = ngZone.runOutsideAngular(
141
+ const unsubscribe = isRestoring() ? () => void 0 : untracked2(
142
+ () => ngZone.runOutsideAngular(
113
143
  () => observer.subscribe(
114
144
  notifyManager.batchCalls((state) => {
115
145
  ngZone.run(() => {
116
- if (state.isError && !state.isFetching && // !isRestoring() && // todo: enable when client persistence is implemented
117
- shouldThrowError(observer.options.throwOnError, [
146
+ if (state.isError && !state.isFetching && shouldThrowError(observer.options.throwOnError, [
118
147
  state.error,
119
148
  observer.getCurrentQuery()
120
149
  ])) {
@@ -125,12 +154,12 @@ function createBaseQuery(optionsFn, Observer) {
125
154
  });
126
155
  })
127
156
  )
128
- );
129
- destroyRef.onDestroy(unsubscribe);
130
- });
157
+ )
158
+ );
159
+ onCleanup(unsubscribe);
131
160
  });
132
161
  return signalProxy(
133
- computed2(() => {
162
+ computed3(() => {
134
163
  const subscriberResult = resultFromSubscriberSignal();
135
164
  const optimisticResult = optimisticResultSignal();
136
165
  return subscriberResult ?? optimisticResult;
@@ -138,25 +167,12 @@ function createBaseQuery(optionsFn, Observer) {
138
167
  );
139
168
  }
140
169
 
141
- // src/util/assert-injector/assert-injector.ts
142
- import {
143
- Injector,
144
- assertInInjectionContext,
145
- inject as inject2,
146
- runInInjectionContext
147
- } from "@angular/core";
148
- function assertInjector(fn, injector, runner) {
149
- !injector && assertInInjectionContext(fn);
150
- const assertedInjector = injector ?? inject2(Injector);
151
- if (!runner) return assertedInjector;
152
- return runInInjectionContext(assertedInjector, runner);
153
- }
154
-
155
170
  // src/inject-infinite-query.ts
156
171
  function injectInfiniteQuery(injectInfiniteQueryFn, options) {
157
- return assertInjector(
158
- injectInfiniteQuery,
159
- options?.injector,
172
+ !options?.injector && assertInInjectionContext2(injectInfiniteQuery);
173
+ const injector = options?.injector ?? inject3(Injector2);
174
+ return runInInjectionContext(
175
+ injector,
160
176
  () => createBaseQuery(
161
177
  injectInfiniteQueryFn,
162
178
  InfiniteQueryObserver
@@ -165,70 +181,86 @@ function injectInfiniteQuery(injectInfiniteQueryFn, options) {
165
181
  }
166
182
 
167
183
  // src/inject-is-fetching.ts
168
- import { DestroyRef as DestroyRef2, NgZone as NgZone2, inject as inject3, signal as signal2 } from "@angular/core";
184
+ import {
185
+ DestroyRef,
186
+ Injector as Injector3,
187
+ NgZone as NgZone2,
188
+ assertInInjectionContext as assertInInjectionContext3,
189
+ inject as inject4,
190
+ signal as signal2
191
+ } from "@angular/core";
169
192
  import { QueryClient as QueryClient2, notifyManager as notifyManager2 } from "@tanstack/query-core";
170
193
  function injectIsFetching(filters, options) {
171
- return assertInjector(injectIsFetching, options?.injector, () => {
172
- const destroyRef = inject3(DestroyRef2);
173
- const ngZone = inject3(NgZone2);
174
- const queryClient = inject3(QueryClient2);
175
- const cache = queryClient.getQueryCache();
176
- let isFetching = queryClient.isFetching(filters);
177
- const result = signal2(isFetching);
178
- const unsubscribe = ngZone.runOutsideAngular(
179
- () => cache.subscribe(
180
- notifyManager2.batchCalls(() => {
181
- const newIsFetching = queryClient.isFetching(filters);
182
- if (isFetching !== newIsFetching) {
183
- isFetching = newIsFetching;
184
- ngZone.run(() => {
185
- result.set(isFetching);
186
- });
187
- }
188
- })
189
- )
190
- );
191
- destroyRef.onDestroy(unsubscribe);
192
- return result;
193
- });
194
+ !options?.injector && assertInInjectionContext3(injectIsFetching);
195
+ const injector = options?.injector ?? inject4(Injector3);
196
+ const destroyRef = injector.get(DestroyRef);
197
+ const ngZone = injector.get(NgZone2);
198
+ const queryClient = injector.get(QueryClient2);
199
+ const cache = queryClient.getQueryCache();
200
+ let isFetching = queryClient.isFetching(filters);
201
+ const result = signal2(isFetching);
202
+ const unsubscribe = ngZone.runOutsideAngular(
203
+ () => cache.subscribe(
204
+ notifyManager2.batchCalls(() => {
205
+ const newIsFetching = queryClient.isFetching(filters);
206
+ if (isFetching !== newIsFetching) {
207
+ isFetching = newIsFetching;
208
+ ngZone.run(() => {
209
+ result.set(isFetching);
210
+ });
211
+ }
212
+ })
213
+ )
214
+ );
215
+ destroyRef.onDestroy(unsubscribe);
216
+ return result;
194
217
  }
195
218
 
196
219
  // src/inject-is-mutating.ts
197
- import { DestroyRef as DestroyRef3, NgZone as NgZone3, inject as inject4, signal as signal3 } from "@angular/core";
220
+ import {
221
+ DestroyRef as DestroyRef2,
222
+ Injector as Injector4,
223
+ NgZone as NgZone3,
224
+ assertInInjectionContext as assertInInjectionContext4,
225
+ inject as inject5,
226
+ signal as signal3
227
+ } from "@angular/core";
198
228
  import { QueryClient as QueryClient3, notifyManager as notifyManager3 } from "@tanstack/query-core";
199
229
  function injectIsMutating(filters, options) {
200
- return assertInjector(injectIsMutating, options?.injector, () => {
201
- const destroyRef = inject4(DestroyRef3);
202
- const ngZone = inject4(NgZone3);
203
- const queryClient = inject4(QueryClient3);
204
- const cache = queryClient.getMutationCache();
205
- let isMutating = queryClient.isMutating(filters);
206
- const result = signal3(isMutating);
207
- const unsubscribe = ngZone.runOutsideAngular(
208
- () => cache.subscribe(
209
- notifyManager3.batchCalls(() => {
210
- const newIsMutating = queryClient.isMutating(filters);
211
- if (isMutating !== newIsMutating) {
212
- isMutating = newIsMutating;
213
- ngZone.run(() => {
214
- result.set(isMutating);
215
- });
216
- }
217
- })
218
- )
219
- );
220
- destroyRef.onDestroy(unsubscribe);
221
- return result;
222
- });
230
+ !options?.injector && assertInInjectionContext4(injectIsMutating);
231
+ const injector = options?.injector ?? inject5(Injector4);
232
+ const destroyRef = injector.get(DestroyRef2);
233
+ const ngZone = injector.get(NgZone3);
234
+ const queryClient = injector.get(QueryClient3);
235
+ const cache = queryClient.getMutationCache();
236
+ let isMutating = queryClient.isMutating(filters);
237
+ const result = signal3(isMutating);
238
+ const unsubscribe = ngZone.runOutsideAngular(
239
+ () => cache.subscribe(
240
+ notifyManager3.batchCalls(() => {
241
+ const newIsMutating = queryClient.isMutating(filters);
242
+ if (isMutating !== newIsMutating) {
243
+ isMutating = newIsMutating;
244
+ ngZone.run(() => {
245
+ result.set(isMutating);
246
+ });
247
+ }
248
+ })
249
+ )
250
+ );
251
+ destroyRef.onDestroy(unsubscribe);
252
+ return result;
223
253
  }
224
254
 
225
255
  // src/inject-mutation.ts
226
256
  import {
227
- DestroyRef as DestroyRef4,
257
+ DestroyRef as DestroyRef3,
258
+ Injector as Injector5,
228
259
  NgZone as NgZone4,
229
- computed as computed3,
260
+ assertInInjectionContext as assertInInjectionContext5,
261
+ computed as computed4,
230
262
  effect as effect2,
231
- inject as inject5,
263
+ inject as inject6,
232
264
  signal as signal4,
233
265
  untracked as untracked3
234
266
  } from "@angular/core";
@@ -238,82 +270,88 @@ import {
238
270
  notifyManager as notifyManager4
239
271
  } from "@tanstack/query-core";
240
272
  function injectMutation(injectMutationFn, options) {
241
- return assertInjector(injectMutation, options?.injector, () => {
242
- const destroyRef = inject5(DestroyRef4);
243
- const ngZone = inject5(NgZone4);
244
- const queryClient = inject5(QueryClient4);
245
- const optionsSignal = computed3(injectMutationFn);
246
- const observerSignal = (() => {
247
- let instance = null;
248
- return computed3(() => {
249
- return instance ||= new MutationObserver(queryClient, optionsSignal());
250
- });
251
- })();
252
- const mutateFnSignal = computed3(() => {
253
- const observer = observerSignal();
254
- return (variables, mutateOptions) => {
255
- observer.mutate(variables, mutateOptions).catch(noop);
256
- };
273
+ !options?.injector && assertInInjectionContext5(injectMutation);
274
+ const injector = options?.injector ?? inject6(Injector5);
275
+ const destroyRef = injector.get(DestroyRef3);
276
+ const ngZone = injector.get(NgZone4);
277
+ const queryClient = injector.get(QueryClient4);
278
+ const optionsSignal = computed4(injectMutationFn);
279
+ const observerSignal = (() => {
280
+ let instance = null;
281
+ return computed4(() => {
282
+ return instance ||= new MutationObserver(queryClient, optionsSignal());
257
283
  });
258
- const resultFromInitialOptionsSignal = computed3(() => {
284
+ })();
285
+ const mutateFnSignal = computed4(() => {
286
+ const observer = observerSignal();
287
+ return (variables, mutateOptions) => {
288
+ observer.mutate(variables, mutateOptions).catch(noop);
289
+ };
290
+ });
291
+ const resultFromInitialOptionsSignal = computed4(() => {
292
+ const observer = observerSignal();
293
+ return observer.getCurrentResult();
294
+ });
295
+ const resultFromSubscriberSignal = signal4(null);
296
+ effect2(
297
+ () => {
259
298
  const observer = observerSignal();
260
- return observer.getCurrentResult();
261
- });
262
- const resultFromSubscriberSignal = signal4(null);
263
- effect2(
264
- () => {
265
- const observer = observerSignal();
266
- const observerOptions = optionsSignal();
267
- untracked3(() => {
268
- observer.setOptions(observerOptions);
269
- });
270
- },
271
- {
272
- injector: options?.injector
273
- }
274
- );
275
- effect2(
276
- () => {
277
- const observer = observerSignal();
278
- untracked3(() => {
279
- const unsubscribe = ngZone.runOutsideAngular(
280
- () => observer.subscribe(
281
- notifyManager4.batchCalls((state) => {
282
- ngZone.run(() => {
283
- if (state.isError && shouldThrowError(observer.options.throwOnError, [
284
- state.error
285
- ])) {
286
- ngZone.onError.emit(state.error);
287
- throw state.error;
288
- }
289
- resultFromSubscriberSignal.set(state);
290
- });
291
- })
292
- )
293
- );
294
- destroyRef.onDestroy(unsubscribe);
295
- });
296
- },
297
- {
298
- injector: options?.injector
299
- }
300
- );
301
- const resultSignal = computed3(() => {
302
- const resultFromSubscriber = resultFromSubscriberSignal();
303
- const resultFromInitialOptions = resultFromInitialOptionsSignal();
304
- const result = resultFromSubscriber ?? resultFromInitialOptions;
305
- return {
306
- ...result,
307
- mutate: mutateFnSignal(),
308
- mutateAsync: result.mutate
309
- };
310
- });
311
- return signalProxy(resultSignal);
299
+ const observerOptions = optionsSignal();
300
+ untracked3(() => {
301
+ observer.setOptions(observerOptions);
302
+ });
303
+ },
304
+ {
305
+ injector
306
+ }
307
+ );
308
+ effect2(
309
+ () => {
310
+ const observer = observerSignal();
311
+ untracked3(() => {
312
+ const unsubscribe = ngZone.runOutsideAngular(
313
+ () => observer.subscribe(
314
+ notifyManager4.batchCalls((state) => {
315
+ ngZone.run(() => {
316
+ if (state.isError && shouldThrowError(observer.options.throwOnError, [state.error])) {
317
+ ngZone.onError.emit(state.error);
318
+ throw state.error;
319
+ }
320
+ resultFromSubscriberSignal.set(state);
321
+ });
322
+ })
323
+ )
324
+ );
325
+ destroyRef.onDestroy(unsubscribe);
326
+ });
327
+ },
328
+ {
329
+ injector
330
+ }
331
+ );
332
+ const resultSignal = computed4(() => {
333
+ const resultFromSubscriber = resultFromSubscriberSignal();
334
+ const resultFromInitialOptions = resultFromInitialOptionsSignal();
335
+ const result = resultFromSubscriber ?? resultFromInitialOptions;
336
+ return {
337
+ ...result,
338
+ mutate: mutateFnSignal(),
339
+ mutateAsync: result.mutate
340
+ };
312
341
  });
342
+ return signalProxy(resultSignal);
313
343
  }
314
344
 
315
345
  // src/inject-mutation-state.ts
316
- import { DestroyRef as DestroyRef5, NgZone as NgZone5, computed as computed4, inject as inject6, signal as signal5 } from "@angular/core";
346
+ import {
347
+ DestroyRef as DestroyRef4,
348
+ Injector as Injector6,
349
+ NgZone as NgZone5,
350
+ assertInInjectionContext as assertInInjectionContext6,
351
+ computed as computed5,
352
+ inject as inject7,
353
+ signal as signal5
354
+ } from "@angular/core";
317
355
  import {
318
356
  QueryClient as QueryClient5,
319
357
  notifyManager as notifyManager5,
@@ -325,44 +363,44 @@ function getResult(mutationCache, options) {
325
363
  );
326
364
  }
327
365
  function injectMutationState(injectMutationStateFn = () => ({}), options) {
328
- return assertInjector(injectMutationState, options?.injector, () => {
329
- const destroyRef = inject6(DestroyRef5);
330
- const ngZone = inject6(NgZone5);
331
- const queryClient = inject6(QueryClient5);
332
- const mutationCache = queryClient.getMutationCache();
333
- const resultFromOptionsSignal = computed4(() => {
334
- return [
335
- getResult(mutationCache, injectMutationStateFn()),
336
- performance.now()
337
- ];
338
- });
339
- const resultFromSubscriberSignal = signal5(
340
- null
341
- );
342
- const effectiveResultSignal = computed4(() => {
343
- const optionsResult = resultFromOptionsSignal();
344
- const subscriberResult = resultFromSubscriberSignal();
345
- return subscriberResult && subscriberResult[1] > optionsResult[1] ? subscriberResult[0] : optionsResult[0];
346
- });
347
- const unsubscribe = ngZone.runOutsideAngular(
348
- () => mutationCache.subscribe(
349
- notifyManager5.batchCalls(() => {
350
- const [lastResult] = effectiveResultSignal();
351
- const nextResult = replaceEqualDeep(
352
- lastResult,
353
- getResult(mutationCache, injectMutationStateFn())
354
- );
355
- if (lastResult !== nextResult) {
356
- ngZone.run(() => {
357
- resultFromSubscriberSignal.set([nextResult, performance.now()]);
358
- });
359
- }
360
- })
361
- )
362
- );
363
- destroyRef.onDestroy(unsubscribe);
364
- return effectiveResultSignal;
366
+ !options?.injector && assertInInjectionContext6(injectMutationState);
367
+ const injector = options?.injector ?? inject7(Injector6);
368
+ const destroyRef = injector.get(DestroyRef4);
369
+ const ngZone = injector.get(NgZone5);
370
+ const queryClient = injector.get(QueryClient5);
371
+ const mutationCache = queryClient.getMutationCache();
372
+ const resultFromOptionsSignal = computed5(() => {
373
+ return [
374
+ getResult(mutationCache, injectMutationStateFn()),
375
+ performance.now()
376
+ ];
377
+ });
378
+ const resultFromSubscriberSignal = signal5(
379
+ null
380
+ );
381
+ const effectiveResultSignal = computed5(() => {
382
+ const optionsResult = resultFromOptionsSignal();
383
+ const subscriberResult = resultFromSubscriberSignal();
384
+ return subscriberResult && subscriberResult[1] > optionsResult[1] ? subscriberResult[0] : optionsResult[0];
365
385
  });
386
+ const unsubscribe = ngZone.runOutsideAngular(
387
+ () => mutationCache.subscribe(
388
+ notifyManager5.batchCalls(() => {
389
+ const [lastResult] = effectiveResultSignal();
390
+ const nextResult = replaceEqualDeep(
391
+ lastResult,
392
+ getResult(mutationCache, injectMutationStateFn())
393
+ );
394
+ if (lastResult !== nextResult) {
395
+ ngZone.run(() => {
396
+ resultFromSubscriberSignal.set([nextResult, performance.now()]);
397
+ });
398
+ }
399
+ })
400
+ )
401
+ );
402
+ destroyRef.onDestroy(unsubscribe);
403
+ return effectiveResultSignal;
366
404
  }
367
405
 
368
406
  // src/inject-queries.ts
@@ -372,25 +410,30 @@ import {
372
410
  notifyManager as notifyManager6
373
411
  } from "@tanstack/query-core";
374
412
  import {
375
- DestroyRef as DestroyRef6,
413
+ DestroyRef as DestroyRef5,
414
+ Injector as Injector7,
376
415
  NgZone as NgZone6,
377
- computed as computed5,
416
+ assertInInjectionContext as assertInInjectionContext7,
417
+ computed as computed6,
378
418
  effect as effect3,
379
- inject as inject7,
419
+ inject as inject8,
420
+ runInInjectionContext as runInInjectionContext2,
380
421
  signal as signal6
381
422
  } from "@angular/core";
382
423
  function injectQueries({
383
424
  queries,
384
425
  ...options
385
426
  }, injector) {
386
- return assertInjector(injectQueries, injector, () => {
387
- const destroyRef = inject7(DestroyRef6);
388
- const ngZone = inject7(NgZone6);
389
- const queryClient = inject7(QueryClient6);
390
- const defaultedQueries = computed5(() => {
427
+ !injector && assertInInjectionContext7(injectQueries);
428
+ return runInInjectionContext2(injector ?? inject8(Injector7), () => {
429
+ const destroyRef = inject8(DestroyRef5);
430
+ const ngZone = inject8(NgZone6);
431
+ const queryClient = inject8(QueryClient6);
432
+ const isRestoring = injectIsRestoring();
433
+ const defaultedQueries = computed6(() => {
391
434
  return queries().map((opts) => {
392
435
  const defaultedOptions = queryClient.defaultQueryOptions(opts);
393
- defaultedOptions._optimisticResults = "optimistic";
436
+ defaultedOptions._optimisticResults = isRestoring() ? "isRestoring" : "optimistic";
394
437
  return defaultedOptions;
395
438
  });
396
439
  });
@@ -410,39 +453,47 @@ function injectQueries({
410
453
  options.combine
411
454
  );
412
455
  const result = signal6(getCombinedResult());
413
- const unsubscribe = ngZone.runOutsideAngular(
414
- () => observer.subscribe(notifyManager6.batchCalls(result.set))
415
- );
416
- destroyRef.onDestroy(unsubscribe);
456
+ effect3(() => {
457
+ const unsubscribe = isRestoring() ? () => void 0 : ngZone.runOutsideAngular(
458
+ () => observer.subscribe(notifyManager6.batchCalls(result.set))
459
+ );
460
+ destroyRef.onDestroy(unsubscribe);
461
+ });
417
462
  return result;
418
463
  });
419
464
  }
420
465
 
421
466
  // src/inject-query.ts
422
467
  import { QueryObserver } from "@tanstack/query-core";
468
+ import {
469
+ Injector as Injector8,
470
+ assertInInjectionContext as assertInInjectionContext8,
471
+ inject as inject9,
472
+ runInInjectionContext as runInInjectionContext3
473
+ } from "@angular/core";
423
474
  function injectQuery(injectQueryFn, options) {
424
- return assertInjector(
425
- injectQuery,
426
- options?.injector,
475
+ !options?.injector && assertInInjectionContext8(injectQuery);
476
+ return runInInjectionContext3(
477
+ options?.injector ?? inject9(Injector8),
427
478
  () => createBaseQuery(injectQueryFn, QueryObserver)
428
479
  );
429
480
  }
430
481
 
431
482
  // src/inject-query-client.ts
432
- import { Injector as Injector2, inject as inject8 } from "@angular/core";
483
+ import { Injector as Injector9, inject as inject10 } from "@angular/core";
433
484
  import { QueryClient as QueryClient7 } from "@tanstack/query-core";
434
485
  function injectQueryClient(injectOptions = {}) {
435
- return (injectOptions.injector ?? inject8(Injector2)).get(QueryClient7);
486
+ return (injectOptions.injector ?? inject10(Injector9)).get(QueryClient7);
436
487
  }
437
488
 
438
489
  // src/providers.ts
439
490
  import {
440
- DestroyRef as DestroyRef7,
491
+ DestroyRef as DestroyRef6,
441
492
  ENVIRONMENT_INITIALIZER,
442
493
  PLATFORM_ID,
443
- computed as computed6,
494
+ computed as computed7,
444
495
  effect as effect4,
445
- inject as inject9,
496
+ inject as inject11,
446
497
  makeEnvironmentProviders
447
498
  } from "@angular/core";
448
499
  import { QueryClient as QueryClient8, onlineManager } from "@tanstack/query-core";
@@ -464,7 +515,7 @@ function provideTanStackQuery(queryClient, ...features) {
464
515
  multi: true,
465
516
  useValue: () => {
466
517
  queryClient.mount();
467
- inject9(DestroyRef7).onDestroy(() => queryClient.unmount());
518
+ inject11(DestroyRef6).onDestroy(() => queryClient.unmount());
468
519
  }
469
520
  },
470
521
  features.map((feature) => feature.\u0275providers)
@@ -487,15 +538,15 @@ function withDevtools(withDevtoolsFn) {
487
538
  provide: ENVIRONMENT_INITIALIZER,
488
539
  multi: true,
489
540
  useFactory: () => {
490
- if (!isPlatformBrowser(inject9(PLATFORM_ID))) return noop;
491
- const injectedClient = inject9(QueryClient8, {
541
+ if (!isPlatformBrowser(inject11(PLATFORM_ID))) return noop;
542
+ const injectedClient = inject11(QueryClient8, {
492
543
  optional: true
493
544
  });
494
- const destroyRef = inject9(DestroyRef7);
495
- const options = computed6(() => withDevtoolsFn?.() ?? {});
545
+ const destroyRef = inject11(DestroyRef6);
546
+ const options = computed7(() => withDevtoolsFn?.() ?? {});
496
547
  let devtools = null;
497
548
  let el = null;
498
- const shouldLoadToolsSignal = computed6(() => {
549
+ const shouldLoadToolsSignal = computed7(() => {
499
550
  const { loadDevtools } = options();
500
551
  return typeof loadDevtools === "boolean" ? loadDevtools : isDevMode();
501
552
  });
@@ -553,12 +604,13 @@ function withDevtools(withDevtoolsFn) {
553
604
  }
554
605
  return queryFeature("DeveloperTools", providers);
555
606
  }
556
- var queryFeatures = ["DeveloperTools"];
607
+ var queryFeatures = ["DeveloperTools", "PersistQueryClient"];
557
608
  export {
558
609
  infiniteQueryOptions,
559
610
  injectInfiniteQuery,
560
611
  injectIsFetching,
561
612
  injectIsMutating,
613
+ injectIsRestoring,
562
614
  injectMutation,
563
615
  injectMutationState,
564
616
  injectQueries,
@@ -566,8 +618,10 @@ export {
566
618
  injectQueryClient,
567
619
  mutationOptions,
568
620
  provideAngularQuery,
621
+ provideIsRestoring,
569
622
  provideQueryClient,
570
623
  provideTanStackQuery,
624
+ queryFeature,
571
625
  queryFeatures,
572
626
  queryOptions,
573
627
  withDevtools