@tanstack/react-query 4.29.22 → 4.29.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/Hydrate.d.ts.map +1 -1
- package/build/lib/Hydrate.esm.js.map +1 -1
- package/build/lib/Hydrate.js.map +1 -1
- package/build/lib/Hydrate.mjs.map +1 -1
- package/build/lib/__tests__/utils.d.ts +1 -1
- package/build/lib/__tests__/utils.d.ts.map +1 -1
- package/build/lib/errorBoundaryUtils.d.ts.map +1 -1
- package/build/lib/errorBoundaryUtils.esm.js.map +1 -1
- package/build/lib/errorBoundaryUtils.js.map +1 -1
- package/build/lib/errorBoundaryUtils.mjs.map +1 -1
- package/build/lib/reactBatchedUpdates.d.ts.map +1 -1
- package/build/lib/reactBatchedUpdates.esm.js.map +1 -1
- package/build/lib/reactBatchedUpdates.js.map +1 -1
- package/build/lib/reactBatchedUpdates.mjs.map +1 -1
- package/build/lib/reactBatchedUpdates.native.d.ts.map +1 -1
- package/build/lib/types.d.ts +1 -1
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/useBaseQuery.d.ts.map +1 -1
- package/build/lib/useBaseQuery.esm.js +1 -1
- package/build/lib/useBaseQuery.esm.js.map +1 -1
- package/build/lib/useBaseQuery.js +1 -1
- package/build/lib/useBaseQuery.js.map +1 -1
- package/build/lib/useBaseQuery.mjs +1 -1
- package/build/lib/useBaseQuery.mjs.map +1 -1
- package/build/lib/useInfiniteQuery.d.ts.map +1 -1
- package/build/lib/useInfiniteQuery.esm.js.map +1 -1
- package/build/lib/useInfiniteQuery.js.map +1 -1
- package/build/lib/useInfiniteQuery.mjs.map +1 -1
- package/build/lib/useIsFetching.d.ts +1 -1
- package/build/lib/useIsFetching.d.ts.map +1 -1
- package/build/lib/useIsFetching.esm.js.map +1 -1
- package/build/lib/useIsFetching.js.map +1 -1
- package/build/lib/useIsFetching.mjs.map +1 -1
- package/build/lib/useIsMutating.d.ts +1 -1
- package/build/lib/useIsMutating.d.ts.map +1 -1
- package/build/lib/useIsMutating.esm.js +1 -1
- package/build/lib/useIsMutating.esm.js.map +1 -1
- package/build/lib/useIsMutating.js +1 -1
- package/build/lib/useIsMutating.js.map +1 -1
- package/build/lib/useIsMutating.mjs +1 -1
- package/build/lib/useIsMutating.mjs.map +1 -1
- package/build/lib/useMutation.d.ts.map +1 -1
- package/build/lib/useMutation.esm.js +1 -1
- package/build/lib/useMutation.esm.js.map +1 -1
- package/build/lib/useMutation.js +1 -1
- package/build/lib/useMutation.js.map +1 -1
- package/build/lib/useMutation.mjs +1 -1
- package/build/lib/useMutation.mjs.map +1 -1
- package/build/lib/useQueries.d.ts +1 -1
- package/build/lib/useQueries.d.ts.map +1 -1
- package/build/lib/useQueries.esm.js +1 -3
- package/build/lib/useQueries.esm.js.map +1 -1
- package/build/lib/useQueries.js +1 -3
- package/build/lib/useQueries.js.map +1 -1
- package/build/lib/useQueries.mjs +1 -3
- package/build/lib/useQueries.mjs.map +1 -1
- package/build/lib/useQuery.d.ts.map +1 -1
- package/build/lib/useQuery.esm.js.map +1 -1
- package/build/lib/useQuery.js.map +1 -1
- package/build/lib/useQuery.mjs.map +1 -1
- package/build/umd/index.development.js +6 -6
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/Hydrate.tsx +1 -1
- package/src/__tests__/Hydrate.test.tsx +4 -4
- package/src/__tests__/QueryClientProvider.test.tsx +2 -2
- package/src/__tests__/QueryResetErrorBoundary.test.tsx +1 -1
- package/src/__tests__/ssr-hydration.test.tsx +2 -2
- package/src/__tests__/ssr.test.tsx +2 -2
- package/src/__tests__/suspense.test.tsx +1 -1
- package/src/__tests__/useInfiniteQuery.test.tsx +1 -1
- package/src/__tests__/useIsFetching.test.tsx +1 -1
- package/src/__tests__/useIsMutating.test.tsx +3 -3
- package/src/__tests__/useMutation.test.tsx +2 -2
- package/src/__tests__/useQueries.test.tsx +1 -1
- package/src/__tests__/useQuery.test.tsx +2 -2
- package/src/__tests__/utils.tsx +2 -2
- package/src/errorBoundaryUtils.ts +2 -2
- package/src/reactBatchedUpdates.native.ts +1 -0
- package/src/reactBatchedUpdates.ts +1 -0
- package/src/types.ts +4 -4
- package/src/useBaseQuery.ts +4 -4
- package/src/useInfiniteQuery.ts +3 -3
- package/src/useIsFetching.ts +2 -2
- package/src/useIsMutating.ts +3 -3
- package/src/useMutation.ts +5 -5
- package/src/useQueries.ts +5 -5
- package/src/useQuery.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-query",
|
|
3
|
-
"version": "4.29.
|
|
3
|
+
"version": "4.29.25",
|
|
4
4
|
"description": "Hooks for managing, caching and syncing asynchronous and remote data in React",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"use-sync-external-store": "^1.2.0",
|
|
50
|
-
"@tanstack/query-core": "4.29.
|
|
50
|
+
"@tanstack/query-core": "4.29.25"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
package/src/Hydrate.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import type { HydrateOptions } from '@tanstack/query-core'
|
|
5
4
|
import { hydrate } from '@tanstack/query-core'
|
|
6
5
|
import { useQueryClient } from './QueryClientProvider'
|
|
6
|
+
import type { HydrateOptions } from '@tanstack/query-core'
|
|
7
7
|
import type { ContextOptions } from './types'
|
|
8
8
|
|
|
9
9
|
export function useHydrate(
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
|
|
4
|
+
import * as coreModule from '@tanstack/query-core'
|
|
4
5
|
import {
|
|
6
|
+
Hydrate,
|
|
7
|
+
QueryCache,
|
|
5
8
|
QueryClient,
|
|
6
9
|
QueryClientProvider,
|
|
7
|
-
QueryCache,
|
|
8
|
-
useQuery,
|
|
9
10
|
dehydrate,
|
|
10
11
|
useHydrate,
|
|
11
|
-
|
|
12
|
+
useQuery,
|
|
12
13
|
} from '@tanstack/react-query'
|
|
13
14
|
import { createQueryClient, sleep } from './utils'
|
|
14
|
-
import * as coreModule from '@tanstack/query-core'
|
|
15
15
|
|
|
16
16
|
describe('React hydration', () => {
|
|
17
17
|
const fetchData: (value: string) => Promise<string> = (value) =>
|
|
@@ -2,14 +2,14 @@ import * as React from 'react'
|
|
|
2
2
|
import { render, waitFor } from '@testing-library/react'
|
|
3
3
|
import { renderToString } from 'react-dom/server'
|
|
4
4
|
|
|
5
|
-
import { sleep, queryKey, createQueryClient } from './utils'
|
|
6
5
|
import {
|
|
6
|
+
QueryCache,
|
|
7
7
|
QueryClient,
|
|
8
8
|
QueryClientProvider,
|
|
9
|
-
QueryCache,
|
|
10
9
|
useQuery,
|
|
11
10
|
useQueryClient,
|
|
12
11
|
} from '..'
|
|
12
|
+
import { createQueryClient, queryKey, sleep } from './utils'
|
|
13
13
|
|
|
14
14
|
describe('QueryClientProvider', () => {
|
|
15
15
|
test('sets a specific cache for all queries to use', async () => {
|
|
@@ -2,8 +2,8 @@ import { fireEvent, waitFor } from '@testing-library/react'
|
|
|
2
2
|
import { ErrorBoundary } from 'react-error-boundary'
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
|
|
5
|
-
import { createQueryClient, queryKey, renderWithClient, sleep } from './utils'
|
|
6
5
|
import { QueryCache, QueryErrorResetBoundary, useQueries, useQuery } from '..'
|
|
6
|
+
import { createQueryClient, queryKey, renderWithClient, sleep } from './utils'
|
|
7
7
|
|
|
8
8
|
// TODO: This should be removed with the types for react-error-boundary get updated.
|
|
9
9
|
declare module 'react-error-boundary' {
|
|
@@ -6,11 +6,11 @@ import ReactDOMServer from 'react-dom/server'
|
|
|
6
6
|
import type {} from 'react-dom/next'
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
useQuery,
|
|
10
|
-
QueryClientProvider,
|
|
11
9
|
QueryCache,
|
|
10
|
+
QueryClientProvider,
|
|
12
11
|
dehydrate,
|
|
13
12
|
hydrate,
|
|
13
|
+
useQuery,
|
|
14
14
|
} from '..'
|
|
15
15
|
import { createQueryClient, setIsServer, sleep } from './utils'
|
|
16
16
|
|
|
@@ -6,8 +6,8 @@ import * as React from 'react'
|
|
|
6
6
|
// @ts-ignore
|
|
7
7
|
import { renderToString } from 'react-dom/server'
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { QueryCache, QueryClientProvider, useInfiniteQuery, useQuery } from '..'
|
|
10
|
+
import { createQueryClient, queryKey, sleep } from './utils'
|
|
11
11
|
|
|
12
12
|
describe('Server Side Rendering', () => {
|
|
13
13
|
it('should not trigger fetch', () => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { fireEvent, waitFor } from '@testing-library/react'
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
import { ErrorBoundary } from 'react-error-boundary'
|
|
4
|
-
import type { UseInfiniteQueryResult, UseQueryResult } from '..'
|
|
5
4
|
import {
|
|
6
5
|
QueryCache,
|
|
7
6
|
QueryErrorResetBoundary,
|
|
@@ -11,6 +10,7 @@ import {
|
|
|
11
10
|
useQueryErrorResetBoundary,
|
|
12
11
|
} from '..'
|
|
13
12
|
import { createQueryClient, queryKey, renderWithClient, sleep } from './utils'
|
|
13
|
+
import type { UseInfiniteQueryResult, UseQueryResult } from '..'
|
|
14
14
|
|
|
15
15
|
describe("useQuery's in Suspense mode", () => {
|
|
16
16
|
const queryCache = new QueryCache()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { fireEvent, waitFor } from '@testing-library/react'
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
+
import { QueryCache, useInfiniteQuery } from '..'
|
|
4
5
|
import {
|
|
5
6
|
createQueryClient,
|
|
6
7
|
queryKey,
|
|
@@ -13,7 +14,6 @@ import type {
|
|
|
13
14
|
QueryFunctionContext,
|
|
14
15
|
UseInfiniteQueryResult,
|
|
15
16
|
} from '..'
|
|
16
|
-
import { QueryCache, useInfiniteQuery } from '..'
|
|
17
17
|
|
|
18
18
|
interface Result {
|
|
19
19
|
items: number[]
|
|
@@ -2,6 +2,7 @@ import { fireEvent, waitFor } from '@testing-library/react'
|
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
import { ErrorBoundary } from 'react-error-boundary'
|
|
4
4
|
|
|
5
|
+
import { QueryCache, useIsFetching, useQuery } from '..'
|
|
5
6
|
import {
|
|
6
7
|
createQueryClient,
|
|
7
8
|
queryKey,
|
|
@@ -10,7 +11,6 @@ import {
|
|
|
10
11
|
sleep,
|
|
11
12
|
} from './utils'
|
|
12
13
|
import type { QueryClient } from '..'
|
|
13
|
-
import { QueryCache, useIsFetching, useQuery } from '..'
|
|
14
14
|
|
|
15
15
|
describe('useIsFetching', () => {
|
|
16
16
|
// See https://github.com/tannerlinsley/react-query/issues/105
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { fireEvent, waitFor } from '@testing-library/react'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
+
import { ErrorBoundary } from 'react-error-boundary'
|
|
4
|
+
import { QueryClient } from '@tanstack/query-core'
|
|
3
5
|
import { useIsMutating } from '../useIsMutating'
|
|
4
6
|
import { useMutation } from '../useMutation'
|
|
7
|
+
import * as MutationCacheModule from '../../../query-core/src/mutationCache'
|
|
5
8
|
import {
|
|
6
9
|
createQueryClient,
|
|
7
10
|
renderWithClient,
|
|
8
11
|
setActTimeout,
|
|
9
12
|
sleep,
|
|
10
13
|
} from './utils'
|
|
11
|
-
import { ErrorBoundary } from 'react-error-boundary'
|
|
12
|
-
import { QueryClient } from '@tanstack/query-core'
|
|
13
|
-
import * as MutationCacheModule from '../../../query-core/src/mutationCache'
|
|
14
14
|
|
|
15
15
|
describe('useIsMutating', () => {
|
|
16
16
|
it('should return the number of fetching mutations', async () => {
|
|
@@ -3,9 +3,7 @@ import '@testing-library/jest-dom'
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import { ErrorBoundary } from 'react-error-boundary'
|
|
5
5
|
|
|
6
|
-
import type { QueryClient } from '..'
|
|
7
6
|
import { MutationCache, QueryCache, useMutation } from '..'
|
|
8
|
-
import type { UseMutationResult } from '../types'
|
|
9
7
|
import {
|
|
10
8
|
createQueryClient,
|
|
11
9
|
mockNavigatorOnLine,
|
|
@@ -14,6 +12,8 @@ import {
|
|
|
14
12
|
setActTimeout,
|
|
15
13
|
sleep,
|
|
16
14
|
} from './utils'
|
|
15
|
+
import type { QueryClient } from '..'
|
|
16
|
+
import type { UseMutationResult } from '../types'
|
|
17
17
|
|
|
18
18
|
describe('useMutation', () => {
|
|
19
19
|
const queryCache = new QueryCache()
|
|
@@ -4,6 +4,7 @@ import { ErrorBoundary } from 'react-error-boundary'
|
|
|
4
4
|
|
|
5
5
|
import * as QueriesObserverModule from '../../../query-core/src/queriesObserver'
|
|
6
6
|
|
|
7
|
+
import { QueriesObserver, QueryCache, useQueries } from '..'
|
|
7
8
|
import {
|
|
8
9
|
createQueryClient,
|
|
9
10
|
expectType,
|
|
@@ -20,7 +21,6 @@ import type {
|
|
|
20
21
|
UseQueryOptions,
|
|
21
22
|
UseQueryResult,
|
|
22
23
|
} from '..'
|
|
23
|
-
import { QueriesObserver, QueryCache, useQueries } from '..'
|
|
24
24
|
import type { QueryFunctionContext } from '@tanstack/query-core'
|
|
25
25
|
|
|
26
26
|
describe('useQueries', () => {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { act, fireEvent, waitFor } from '@testing-library/react'
|
|
2
2
|
import '@testing-library/jest-dom'
|
|
3
3
|
import * as React from 'react'
|
|
4
|
+
import { ErrorBoundary } from 'react-error-boundary'
|
|
5
|
+
import { QueryCache, useQuery } from '..'
|
|
4
6
|
import {
|
|
5
7
|
Blink,
|
|
6
8
|
createQueryClient,
|
|
@@ -20,8 +22,6 @@ import type {
|
|
|
20
22
|
UseQueryOptions,
|
|
21
23
|
UseQueryResult,
|
|
22
24
|
} from '..'
|
|
23
|
-
import { QueryCache, useQuery } from '..'
|
|
24
|
-
import { ErrorBoundary } from 'react-error-boundary'
|
|
25
25
|
|
|
26
26
|
describe('useQuery', () => {
|
|
27
27
|
const queryCache = new QueryCache()
|
package/src/__tests__/utils.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { act, render } from '@testing-library/react'
|
|
3
|
-
import type { ContextOptions, QueryClientConfig, MutationOptions } from '..'
|
|
4
|
-
import { QueryClient, QueryClientProvider } from '..'
|
|
5
3
|
import * as utils from '@tanstack/query-core'
|
|
4
|
+
import { QueryClient, QueryClientProvider } from '..'
|
|
5
|
+
import type { ContextOptions, MutationOptions, QueryClientConfig } from '..'
|
|
6
6
|
|
|
7
7
|
export function renderWithClient(
|
|
8
8
|
client: QueryClient,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { shouldThrowError } from './utils'
|
|
2
4
|
import type {
|
|
3
5
|
DefaultedQueryObserverOptions,
|
|
4
6
|
Query,
|
|
@@ -7,8 +9,6 @@ import type {
|
|
|
7
9
|
UseErrorBoundary,
|
|
8
10
|
} from '@tanstack/query-core'
|
|
9
11
|
import type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'
|
|
10
|
-
import * as React from 'react'
|
|
11
|
-
import { shouldThrowError } from './utils'
|
|
12
12
|
|
|
13
13
|
export const ensurePreventErrorBoundaryRetry = <
|
|
14
14
|
TQueryFnData,
|
package/src/types.ts
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import type * as React from 'react'
|
|
4
4
|
import type {
|
|
5
|
+
DefinedQueryObserverResult,
|
|
5
6
|
InfiniteQueryObserverOptions,
|
|
6
7
|
InfiniteQueryObserverResult,
|
|
8
|
+
MutateFunction,
|
|
9
|
+
MutationObserverOptions,
|
|
7
10
|
MutationObserverResult,
|
|
11
|
+
QueryKey,
|
|
8
12
|
QueryObserverOptions,
|
|
9
13
|
QueryObserverResult,
|
|
10
|
-
QueryKey,
|
|
11
|
-
MutationObserverOptions,
|
|
12
|
-
MutateFunction,
|
|
13
|
-
DefinedQueryObserverResult,
|
|
14
14
|
} from '@tanstack/query-core'
|
|
15
15
|
import type { QueryClient } from '@tanstack/query-core'
|
|
16
16
|
|
package/src/useBaseQuery.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
4
3
|
|
|
5
|
-
import type { QueryKey, QueryObserver } from '@tanstack/query-core'
|
|
6
4
|
import { notifyManager } from '@tanstack/query-core'
|
|
5
|
+
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
7
6
|
import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'
|
|
8
7
|
import { useQueryClient } from './QueryClientProvider'
|
|
9
|
-
import type { UseBaseQueryOptions } from './types'
|
|
10
8
|
import { useIsRestoring } from './isRestoring'
|
|
11
9
|
import {
|
|
12
10
|
ensurePreventErrorBoundaryRetry,
|
|
13
11
|
getHasError,
|
|
14
12
|
useClearResetErrorBoundary,
|
|
15
13
|
} from './errorBoundaryUtils'
|
|
16
|
-
import { ensureStaleTime,
|
|
14
|
+
import { ensureStaleTime, fetchOptimistic, shouldSuspend } from './suspense'
|
|
15
|
+
import type { QueryKey, QueryObserver } from '@tanstack/query-core'
|
|
16
|
+
import type { UseBaseQueryOptions } from './types'
|
|
17
17
|
|
|
18
18
|
export function useBaseQuery<
|
|
19
19
|
TQueryFnData,
|
package/src/useInfiniteQuery.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
import { InfiniteQueryObserver, parseQueryArgs } from '@tanstack/query-core'
|
|
3
|
+
import { useBaseQuery } from './useBaseQuery'
|
|
2
4
|
import type {
|
|
3
|
-
QueryObserver,
|
|
4
5
|
QueryFunction,
|
|
5
6
|
QueryKey,
|
|
7
|
+
QueryObserver,
|
|
6
8
|
} from '@tanstack/query-core'
|
|
7
|
-
import { InfiniteQueryObserver, parseQueryArgs } from '@tanstack/query-core'
|
|
8
9
|
import type { UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types'
|
|
9
|
-
import { useBaseQuery } from './useBaseQuery'
|
|
10
10
|
|
|
11
11
|
// HOOK
|
|
12
12
|
|
package/src/useIsFetching.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import type { QueryKey, QueryFilters } from '@tanstack/query-core'
|
|
4
3
|
import { notifyManager, parseFilterArgs } from '@tanstack/query-core'
|
|
5
4
|
|
|
6
5
|
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
7
|
-
import type { ContextOptions } from './types'
|
|
8
6
|
import { useQueryClient } from './QueryClientProvider'
|
|
7
|
+
import type { ContextOptions } from './types'
|
|
8
|
+
import type { QueryFilters, QueryKey } from '@tanstack/query-core'
|
|
9
9
|
|
|
10
10
|
interface Options extends ContextOptions {}
|
|
11
11
|
|
package/src/useIsMutating.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
+
import { notifyManager, parseMutationFilterArgs } from '@tanstack/query-core'
|
|
3
4
|
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
4
5
|
|
|
5
|
-
import type { MutationKey, MutationFilters } from '@tanstack/query-core'
|
|
6
|
-
import { notifyManager, parseMutationFilterArgs } from '@tanstack/query-core'
|
|
7
|
-
import type { ContextOptions } from './types'
|
|
8
6
|
import { useQueryClient } from './QueryClientProvider'
|
|
7
|
+
import type { MutationFilters, MutationKey } from '@tanstack/query-core'
|
|
8
|
+
import type { ContextOptions } from './types'
|
|
9
9
|
|
|
10
10
|
interface Options extends ContextOptions {}
|
|
11
11
|
|
package/src/useMutation.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
4
|
-
|
|
5
|
-
import type { MutationFunction, MutationKey } from '@tanstack/query-core'
|
|
6
3
|
import {
|
|
4
|
+
MutationObserver,
|
|
7
5
|
notifyManager,
|
|
8
6
|
parseMutationArgs,
|
|
9
|
-
MutationObserver,
|
|
10
7
|
} from '@tanstack/query-core'
|
|
8
|
+
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
9
|
+
|
|
11
10
|
import { useQueryClient } from './QueryClientProvider'
|
|
11
|
+
import { shouldThrowError } from './utils'
|
|
12
|
+
import type { MutationFunction, MutationKey } from '@tanstack/query-core'
|
|
12
13
|
import type {
|
|
13
14
|
UseMutateFunction,
|
|
14
15
|
UseMutationOptions,
|
|
15
16
|
UseMutationResult,
|
|
16
17
|
} from './types'
|
|
17
|
-
import { shouldThrowError } from './utils'
|
|
18
18
|
|
|
19
19
|
// HOOK
|
|
20
20
|
|
package/src/useQueries.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
4
3
|
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import { QueriesObserver, notifyManager } from '@tanstack/query-core'
|
|
5
|
+
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
7
6
|
import { useQueryClient } from './QueryClientProvider'
|
|
8
|
-
import type { UseQueryOptions, UseQueryResult } from './types'
|
|
9
7
|
import { useIsRestoring } from './isRestoring'
|
|
10
8
|
import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'
|
|
11
9
|
import {
|
|
@@ -15,10 +13,12 @@ import {
|
|
|
15
13
|
} from './errorBoundaryUtils'
|
|
16
14
|
import {
|
|
17
15
|
ensureStaleTime,
|
|
18
|
-
shouldSuspend,
|
|
19
16
|
fetchOptimistic,
|
|
17
|
+
shouldSuspend,
|
|
20
18
|
willFetch,
|
|
21
19
|
} from './suspense'
|
|
20
|
+
import type { QueryFunction, QueryKey } from '@tanstack/query-core'
|
|
21
|
+
import type { UseQueryOptions, UseQueryResult } from './types'
|
|
22
22
|
|
|
23
23
|
// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.
|
|
24
24
|
// - `context` is omitted as it is passed as a root-level option to `useQueries` instead.
|
package/src/useQuery.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
import { QueryObserver, parseQueryArgs } from '@tanstack/query-core'
|
|
3
|
+
import { useBaseQuery } from './useBaseQuery'
|
|
2
4
|
import type { QueryFunction, QueryKey } from '@tanstack/query-core'
|
|
3
|
-
import { parseQueryArgs, QueryObserver } from '@tanstack/query-core'
|
|
4
5
|
import type {
|
|
5
6
|
DefinedUseQueryResult,
|
|
6
7
|
UseQueryOptions,
|
|
7
8
|
UseQueryResult,
|
|
8
9
|
} from './types'
|
|
9
|
-
import { useBaseQuery } from './useBaseQuery'
|
|
10
10
|
|
|
11
11
|
// HOOK
|
|
12
12
|
|