snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
64
docs/framework/vue/reference/variables/VueQueryPlugin.md
Normal file
64
docs/framework/vue/reference/variables/VueQueryPlugin.md
Normal file
@@ -0,0 +1,64 @@
|
||||
---
|
||||
id: VueQueryPlugin
|
||||
title: VueQueryPlugin
|
||||
---
|
||||
|
||||
```ts
|
||||
const VueQueryPlugin: object;
|
||||
```
|
||||
|
||||
Defined in: [packages/vue-query/src/vueQueryPlugin.ts:74](https://github.com/TanStack/query/blob/main/packages/vue-query/src/vueQueryPlugin.ts#L74)
|
||||
|
||||
Installs a `QueryClient` on the Vue app, making it available to every descendant component through
|
||||
`useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin
|
||||
instead of a wrapping component.
|
||||
|
||||
## Type Declaration
|
||||
|
||||
### install()
|
||||
|
||||
```ts
|
||||
install: (app, options) => void;
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
##### app
|
||||
|
||||
`any`
|
||||
|
||||
##### options
|
||||
|
||||
[`VueQueryPluginOptions`](../type-aliases/VueQueryPluginOptions.md) = `{}`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
## Examples
|
||||
|
||||
```ts
|
||||
import { createApp } from 'vue'
|
||||
import { VueQueryPlugin } from '@tanstack/vue-query'
|
||||
|
||||
const app = createApp(App)
|
||||
app.use(VueQueryPlugin)
|
||||
```
|
||||
|
||||
Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per
|
||||
request, or when the same instance also needs to be used outside of Vue components:
|
||||
```ts
|
||||
import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'
|
||||
|
||||
const queryClient = new QueryClient()
|
||||
app.use(VueQueryPlugin, { queryClient })
|
||||
```
|
||||
|
||||
Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:
|
||||
```ts
|
||||
app.use(VueQueryPlugin, {
|
||||
queryClientConfig: {
|
||||
defaultOptions: { queries: { staleTime: 5 * 1000 } },
|
||||
},
|
||||
})
|
||||
```
|
||||
10
docs/framework/vue/reference/variables/dataTagErrorSymbol.md
Normal file
10
docs/framework/vue/reference/variables/dataTagErrorSymbol.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
id: dataTagErrorSymbol
|
||||
title: dataTagErrorSymbol
|
||||
---
|
||||
|
||||
```ts
|
||||
const dataTagErrorSymbol: typeof dataTagErrorSymbol;
|
||||
```
|
||||
|
||||
Defined in: [packages/query-core/src/types.ts:63](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L63)
|
||||
10
docs/framework/vue/reference/variables/dataTagSymbol.md
Normal file
10
docs/framework/vue/reference/variables/dataTagSymbol.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
id: dataTagSymbol
|
||||
title: dataTagSymbol
|
||||
---
|
||||
|
||||
```ts
|
||||
const dataTagSymbol: typeof dataTagSymbol;
|
||||
```
|
||||
|
||||
Defined in: [packages/query-core/src/types.ts:61](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L61)
|
||||
13
docs/framework/vue/reference/variables/defaultScheduler.md
Normal file
13
docs/framework/vue/reference/variables/defaultScheduler.md
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
id: defaultScheduler
|
||||
title: defaultScheduler
|
||||
---
|
||||
|
||||
```ts
|
||||
const defaultScheduler: ScheduleFunction = systemSetTimeoutZero;
|
||||
```
|
||||
|
||||
Defined in: [packages/query-core/src/notifyManager.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L19)
|
||||
|
||||
Default scheduling function used by the notify manager.
|
||||
Schedules the callback with the system's `setTimeout(callback, 0)`.
|
||||
59
docs/framework/vue/reference/variables/environmentManager.md
Normal file
59
docs/framework/vue/reference/variables/environmentManager.md
Normal file
@@ -0,0 +1,59 @@
|
||||
---
|
||||
id: environmentManager
|
||||
title: environmentManager
|
||||
---
|
||||
|
||||
```ts
|
||||
const environmentManager: object;
|
||||
```
|
||||
|
||||
Defined in: [packages/query-core/src/environmentManager.ts:29](https://github.com/TanStack/query/blob/main/packages/query-core/src/environmentManager.ts#L29)
|
||||
|
||||
Manages how TanStack Query detects whether the current runtime should be treated as
|
||||
server-side, which disables scheduling refetch timers and changes the default `retry` count
|
||||
and `gcTime`. By default, the detection treats a missing `window` (or the presence of a
|
||||
`Deno` global) as server.
|
||||
|
||||
Override this for runtimes where that default detection would give the wrong answer — for
|
||||
example, a Service Worker, where `window` is undefined even though the environment should
|
||||
behave like a client.
|
||||
|
||||
## Type Declaration
|
||||
|
||||
### isServer()
|
||||
|
||||
```ts
|
||||
isServer: () => boolean;
|
||||
```
|
||||
|
||||
Returns whether the current runtime should be treated as a server environment.
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
### setIsServer()
|
||||
|
||||
```ts
|
||||
setIsServer(isServerValue): void;
|
||||
```
|
||||
|
||||
Overrides the server check globally.
|
||||
|
||||
#### Parameters
|
||||
|
||||
##### isServerValue
|
||||
|
||||
`IsServerValue`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { environmentManager } from '@tanstack/query-core'
|
||||
|
||||
environmentManager.setIsServer(() => false)
|
||||
```
|
||||
12
docs/framework/vue/reference/variables/focusManager.md
Normal file
12
docs/framework/vue/reference/variables/focusManager.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
id: focusManager
|
||||
title: focusManager
|
||||
---
|
||||
|
||||
```ts
|
||||
const focusManager: FocusManager;
|
||||
```
|
||||
|
||||
Defined in: [packages/query-core/src/focusManager.ts:142](https://github.com/TanStack/query/blob/main/packages/query-core/src/focusManager.ts#L142)
|
||||
|
||||
Singleton instance of [FocusManager](../interfaces/FocusManager.md), used to manage and observe the focus state within TanStack Query.
|
||||
14
docs/framework/vue/reference/variables/isServer.md
Normal file
14
docs/framework/vue/reference/variables/isServer.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
id: isServer
|
||||
title: isServer
|
||||
---
|
||||
|
||||
```ts
|
||||
const isServer: boolean;
|
||||
```
|
||||
|
||||
Defined in: [packages/query-core/src/utils.ts:114](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L114)
|
||||
|
||||
## Deprecated
|
||||
|
||||
use `environmentManager.isServer()` instead.
|
||||
166
docs/framework/vue/reference/variables/notifyManager.md
Normal file
166
docs/framework/vue/reference/variables/notifyManager.md
Normal file
@@ -0,0 +1,166 @@
|
||||
---
|
||||
id: notifyManager
|
||||
title: notifyManager
|
||||
---
|
||||
|
||||
```ts
|
||||
const notifyManager: object;
|
||||
```
|
||||
|
||||
Defined in: [packages/query-core/src/notifyManager.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/notifyManager.ts#L144)
|
||||
|
||||
Handles scheduling and batching callbacks in TanStack Query.
|
||||
|
||||
## Type Declaration
|
||||
|
||||
### batch()
|
||||
|
||||
```ts
|
||||
readonly batch: <T>(callback) => T;
|
||||
```
|
||||
|
||||
Batches all updates scheduled inside the passed callback.
|
||||
This is mainly used internally to optimize query client updating.
|
||||
Batches can be nested; the queue is only flushed once the outermost `batch` call finishes.
|
||||
The return value of `callback` is passed through.
|
||||
|
||||
#### Type Parameters
|
||||
|
||||
##### T
|
||||
|
||||
`T`
|
||||
|
||||
#### Parameters
|
||||
|
||||
##### callback
|
||||
|
||||
() => `T`
|
||||
|
||||
#### Returns
|
||||
|
||||
`T`
|
||||
|
||||
### batchCalls()
|
||||
|
||||
```ts
|
||||
readonly batchCalls: <T>(callback) => BatchCallsCallback<T>;
|
||||
```
|
||||
|
||||
All calls to the wrapped function will be batched.
|
||||
|
||||
#### Type Parameters
|
||||
|
||||
##### T
|
||||
|
||||
`T` *extends* `unknown`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
##### callback
|
||||
|
||||
`BatchCallsCallback`\<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`BatchCallsCallback`\<`T`\>
|
||||
|
||||
### schedule()
|
||||
|
||||
```ts
|
||||
schedule: (callback) => void;
|
||||
```
|
||||
|
||||
Schedules a function to be run on the next batch.
|
||||
By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`.
|
||||
|
||||
#### Parameters
|
||||
|
||||
##### callback
|
||||
|
||||
`NotifyCallback`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
### setBatchNotifyFunction()
|
||||
|
||||
```ts
|
||||
readonly setBatchNotifyFunction: (fn) => void;
|
||||
```
|
||||
|
||||
Use this method to set a custom function to batch notifications together into a single tick.
|
||||
Framework adapters use this to plug in their own batching primitive, so that a single query
|
||||
update only triggers one re-render instead of one per subscriber.
|
||||
|
||||
#### Parameters
|
||||
|
||||
##### fn
|
||||
|
||||
`BatchNotifyFunction`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Example
|
||||
|
||||
```ts
|
||||
import { notifyManager } from '@tanstack/query-core'
|
||||
import { batch } from 'solid-js'
|
||||
|
||||
notifyManager.setBatchNotifyFunction(batch)
|
||||
```
|
||||
|
||||
### setNotifyFunction()
|
||||
|
||||
```ts
|
||||
readonly setNotifyFunction: (fn) => void;
|
||||
```
|
||||
|
||||
Use this method to set a custom notify function.
|
||||
This can be used to for example wrap notifications with `React.act` while running tests.
|
||||
|
||||
#### Parameters
|
||||
|
||||
##### fn
|
||||
|
||||
`NotifyFunction`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
### setScheduler()
|
||||
|
||||
```ts
|
||||
readonly setScheduler: (fn) => void;
|
||||
```
|
||||
|
||||
Configures a custom callback that schedules when the next batch runs.
|
||||
The default behavior is `setTimeout(callback, 0)`.
|
||||
|
||||
#### Parameters
|
||||
|
||||
##### fn
|
||||
|
||||
`ScheduleFunction`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Example
|
||||
|
||||
```ts
|
||||
import { notifyManager } from '@tanstack/query-core'
|
||||
|
||||
// Schedule batches in the next microtask
|
||||
notifyManager.setScheduler(queueMicrotask)
|
||||
|
||||
// Schedule batches before the next frame is rendered
|
||||
notifyManager.setScheduler(requestAnimationFrame)
|
||||
|
||||
// Schedule batches some time in the future
|
||||
notifyManager.setScheduler((cb) => setTimeout(cb, 10))
|
||||
```
|
||||
12
docs/framework/vue/reference/variables/onlineManager.md
Normal file
12
docs/framework/vue/reference/variables/onlineManager.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
id: onlineManager
|
||||
title: onlineManager
|
||||
---
|
||||
|
||||
```ts
|
||||
const onlineManager: OnlineManager;
|
||||
```
|
||||
|
||||
Defined in: [packages/query-core/src/onlineManager.ts:117](https://github.com/TanStack/query/blob/main/packages/query-core/src/onlineManager.ts#L117)
|
||||
|
||||
Singleton instance of [OnlineManager](../interfaces/OnlineManager.md), used to manage and observe the online state within TanStack Query.
|
||||
23
docs/framework/vue/reference/variables/skipToken.md
Normal file
23
docs/framework/vue/reference/variables/skipToken.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
id: skipToken
|
||||
title: skipToken
|
||||
---
|
||||
|
||||
```ts
|
||||
const skipToken: typeof skipToken;
|
||||
```
|
||||
|
||||
Defined in: [packages/query-core/src/utils.ts:522](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L522)
|
||||
|
||||
Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent
|
||||
to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`,
|
||||
a query disabled via `skipToken` cannot be triggered with `refetch`.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
new QueryObserver(queryClient, {
|
||||
queryKey: ['post', postId],
|
||||
queryFn: postId != null ? () => fetchPost(postId) : skipToken,
|
||||
})
|
||||
```
|
||||
12
docs/framework/vue/reference/variables/timeoutManager.md
Normal file
12
docs/framework/vue/reference/variables/timeoutManager.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
id: timeoutManager
|
||||
title: timeoutManager
|
||||
---
|
||||
|
||||
```ts
|
||||
const timeoutManager: TimeoutManager;
|
||||
```
|
||||
|
||||
Defined in: [packages/query-core/src/timeoutManager.ts:232](https://github.com/TanStack/query/blob/main/packages/query-core/src/timeoutManager.ts#L232)
|
||||
|
||||
Singleton instance of [TimeoutManager](../interfaces/TimeoutManager.md), used throughout TanStack Query to schedule and cancel timers.
|
||||
10
docs/framework/vue/reference/variables/unsetMarker.md
Normal file
10
docs/framework/vue/reference/variables/unsetMarker.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
id: unsetMarker
|
||||
title: unsetMarker
|
||||
---
|
||||
|
||||
```ts
|
||||
const unsetMarker: typeof unsetMarker;
|
||||
```
|
||||
|
||||
Defined in: [packages/query-core/src/types.ts:65](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L65)
|
||||
Reference in New Issue
Block a user