Skip to content

Commit f2fb523

Browse files
authoredJan 3, 2025··
refactor(angular-query): deprecate injectQueryClient (#8497)
1 parent 6184a89 commit f2fb523

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎packages/angular-query-experimental/src/inject-query-client.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ import type { InjectOptions } from '@angular/core'
44

55
/**
66
* Injects a `QueryClient` instance and allows passing a custom injector.
7+
* @param injectOptions - Type of the options argument to inject and optionally a custom injector.
8+
* @returns The `QueryClient` instance.
9+
* @public
10+
* @deprecated Use `inject(QueryClient)` instead.
11+
* If you need to get a `QueryClient` from a custom injector, use `injector.get(QueryClient)`.
712
*
8-
* You can also use `inject(QueryClient)` if you don't need to provide a custom injector.
913
*
1014
* **Example**
1115
* ```ts
1216
* const queryClient = injectQueryClient();
1317
* ```
14-
* @param injectOptions - Type of the options argument to inject and optionally a custom injector.
15-
* @returns The `QueryClient` instance.
16-
* @public
1718
*/
1819
export function injectQueryClient(
1920
injectOptions: InjectOptions & { injector?: Injector } = {},

0 commit comments

Comments
 (0)
Please sign in to comment.