snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
Some checks failed
autofix.ci / autofix (push) Failing after 4s
Release / Release (push) Has been skipped
GitHub Actions Security Analysis / Run zizmor (push) Failing after 2s

This commit is contained in:
upstream-mirror
2026-09-16 01:13:08 +05:00
commit 3a013ccdfe
3570 changed files with 490194 additions and 0 deletions

View 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)

View 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)

View 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)`.

View 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)
```

View 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.

View 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.

View 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))
```

View 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.

View File

@@ -0,0 +1,16 @@
---
id: queryClientContext
title: queryClientContext
---
```ts
const queryClientContext: object;
```
Defined in: [packages/lit-query/src/context.ts:11](https://github.com/TanStack/query/blob/main/packages/lit-query/src/context.ts#L11)
Lit context key used by `QueryClientProvider` and host-bound APIs to share a
`QueryClient` through the DOM tree.
Most applications use `QueryClientProvider` instead of interacting with this
context directly.

View 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,
})
```

View 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.

View 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)