Skip to content

Commit

Permalink
refactor(angular-query): deprecate injectQueryClient (#8497)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoud-dv authored Jan 3, 2025
1 parent 6184a89 commit f2fb523
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import type { InjectOptions } from '@angular/core'

/**
* Injects a `QueryClient` instance and allows passing a custom injector.
* @param injectOptions - Type of the options argument to inject and optionally a custom injector.
* @returns The `QueryClient` instance.
* @public
* @deprecated Use `inject(QueryClient)` instead.
* If you need to get a `QueryClient` from a custom injector, use `injector.get(QueryClient)`.
*
* You can also use `inject(QueryClient)` if you don't need to provide a custom injector.
*
* **Example**
* ```ts
* const queryClient = injectQueryClient();
* ```
* @param injectOptions - Type of the options argument to inject and optionally a custom injector.
* @returns The `QueryClient` instance.
* @public
*/
export function injectQueryClient(
injectOptions: InjectOptions & { injector?: Injector } = {},
Expand Down

0 comments on commit f2fb523

Please sign in to comment.