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

provideIsRestoring.md

28 lines830 Bytes

1---
2id: provideIsRestoring
3title: provideIsRestoring
4---
5​
6```ts
7function provideIsRestoring(isRestoring: Signal<boolean>): Provider;
8```
9​
10Defined in: [packages/angular-query-experimental/src/inject-is-restoring.ts:48](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-restoring.ts#L48)
11​
12Registers a provider for the restore state read by `injectIsRestoring`. Wire this up wherever you drive a
13restore yourself β€” e.g. a persist-client integration β€” so `injectQuery` and friends can defer subscribing
14to their observer (avoiding a race with the restore) until the restore signal flips back to `false`.
15​
16## Parameters
17​
18### isRestoring
19​
20`Signal`\<`boolean`\>
21​
22A readonly `Signal<boolean>` that tracks the restore state.
23​
24## Returns
25​
26`Provider`
27​
28A provider for the `isRestoring` signal.