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

withdevtools.md

49 lines1.4 KB

1---
2id: withDevtools
3title: withDevtools
4---
5​
6# Function: withDevtools()
7​
8```ts
9function withDevtools(withDevtoolsFn?): DevtoolsFeature
10```
11​
12Enables developer tools.
13​
14**Example**
15​
16```ts
17export const appConfig: ApplicationConfig = {
18 providers: [provideTanStackQuery(new QueryClient(), withDevtools())],
20```
21​
22By default the devtools will be loaded when Angular runs in development mode and rendered in `<body>`.
23​
24If you need more control over when devtools are loaded, you can use the `loadDevtools` option. This is particularly useful if you want to load devtools based on environment configurations. For instance, you might have a test environment running in production mode but still require devtools to be available.
25​
26If you need more control over where devtools are rendered, consider `injectDevtoolsPanel`. This allows rendering devtools inside your own devtools for example.
27​
28## Parameters
29​
30### withDevtoolsFn?
31​
32() => [`DevtoolsOptions`](../../interfaces/devtoolsoptions.md)
33​
34A function that returns `DevtoolsOptions`.
35​
36## Returns
37​
38[`DevtoolsFeature`](../../type-aliases/developertoolsfeature.md)
39​
40A set of providers for use with `provideTanStackQuery`.
41​
42## See
43​
44- [provideTanStackQuery](../providetanstackquery.md)
45- [DevtoolsOptions](../../interfaces/devtoolsoptions.md)
46​
47## Defined in
48​
49[providers.ts:262](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L262)