react-query-kit 3.0.0-beta.1 → 3.0.0-beta.3
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/createInfiniteQuery.esm.js +1 -1
- package/build/lib/createInfiniteQuery.esm.js.map +1 -1
- package/build/lib/createInfiniteQuery.js +2 -22
- package/build/lib/createInfiniteQuery.js.map +1 -1
- package/build/lib/createInfiniteQuery.mjs +1 -1
- package/build/lib/createInfiniteQuery.mjs.map +1 -1
- package/build/lib/createMutation.esm.js +1 -2
- package/build/lib/createMutation.esm.js.map +1 -1
- package/build/lib/createMutation.js +1 -22
- package/build/lib/createMutation.js.map +1 -1
- package/build/lib/createMutation.mjs +1 -2
- package/build/lib/createMutation.mjs.map +1 -1
- package/build/lib/createQuery.esm.js +1 -1
- package/build/lib/createQuery.esm.js.map +1 -1
- package/build/lib/createQuery.js +2 -22
- package/build/lib/createQuery.js.map +1 -1
- package/build/lib/createQuery.mjs +1 -1
- package/build/lib/createQuery.mjs.map +1 -1
- package/build/lib/createSuspenseInfiniteQuery.esm.js +1 -2
- package/build/lib/createSuspenseInfiniteQuery.esm.js.map +1 -1
- package/build/lib/createSuspenseInfiniteQuery.js +1 -22
- package/build/lib/createSuspenseInfiniteQuery.js.map +1 -1
- package/build/lib/createSuspenseInfiniteQuery.mjs +1 -2
- package/build/lib/createSuspenseInfiniteQuery.mjs.map +1 -1
- package/build/lib/createSuspenseQuery.esm.js +1 -2
- package/build/lib/createSuspenseQuery.esm.js.map +1 -1
- package/build/lib/createSuspenseQuery.js +1 -22
- package/build/lib/createSuspenseQuery.js.map +1 -1
- package/build/lib/createSuspenseQuery.mjs +1 -2
- package/build/lib/createSuspenseQuery.mjs.map +1 -1
- package/build/lib/types.d.ts +2 -1
- package/build/lib/utils.d.ts +3 -2
- package/build/lib/utils.esm.js +4 -4
- package/build/lib/utils.esm.js.map +1 -1
- package/build/lib/utils.js +6 -5
- package/build/lib/utils.js.map +1 -1
- package/build/lib/utils.mjs +4 -4
- package/build/lib/utils.mjs.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats.json +84 -102
- package/build/umd/index.development.js +10 -10
- 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/build/zip/zip.esm.js +1 -1
- package/package.json +1 -1
- package/src/createInfiniteQuery.ts +1 -2
- package/src/createMutation.ts +1 -3
- package/src/createQuery.ts +1 -2
- package/src/createSuspenseInfiniteQuery.ts +1 -3
- package/src/createSuspenseQuery.ts +1 -3
- package/src/types.ts +6 -4
- package/src/utils.ts +3 -2
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import * as ReactQuery from '@tanstack/react-query'
|
|
2
|
-
|
|
3
1
|
import { createBaseQuery } from './createBaseQuery'
|
|
4
2
|
import type {
|
|
5
3
|
CompatibleError,
|
|
6
4
|
CreateSuspenseInfiniteQueryOptions,
|
|
7
5
|
SuspenseInfiniteQueryHook,
|
|
8
6
|
} from './types'
|
|
9
|
-
import { isV5, suspenseOptions } from './utils'
|
|
7
|
+
import { ReactQuery, isV5, suspenseOptions } from './utils'
|
|
10
8
|
|
|
11
9
|
export const createSuspenseInfiniteQuery = <
|
|
12
10
|
TFnData,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import * as ReactQuery from '@tanstack/react-query'
|
|
2
|
-
|
|
3
1
|
import { createBaseQuery } from './createBaseQuery'
|
|
4
2
|
import type {
|
|
5
3
|
CompatibleError,
|
|
6
4
|
CreateSuspenseQueryOptions,
|
|
7
5
|
SuspenseQueryHook,
|
|
8
6
|
} from './types'
|
|
9
|
-
import { isV5, suspenseOptions } from './utils'
|
|
7
|
+
import { ReactQuery, isV5, suspenseOptions } from './utils'
|
|
10
8
|
|
|
11
9
|
export const createSuspenseQuery = <
|
|
12
10
|
TFnData,
|
package/src/types.ts
CHANGED
|
@@ -56,11 +56,13 @@ type WithRequired<T, K extends keyof T> = T & {
|
|
|
56
56
|
|
|
57
57
|
export type CompatibleError = CompatibleWithV4<DefaultError, Error>
|
|
58
58
|
|
|
59
|
+
export type Fetcher<TFnData, TVariables = void, TPageParam = number> = (
|
|
60
|
+
variables: TVariables,
|
|
61
|
+
context: QueryFunctionContext<QueryKey, TPageParam>
|
|
62
|
+
) => TFnData | Promise<TFnData>
|
|
63
|
+
|
|
59
64
|
export type AdditionalQueryOptions<TFnData, TVariables, TPageParam = never> = {
|
|
60
|
-
fetcher:
|
|
61
|
-
variables: TVariables,
|
|
62
|
-
context: QueryFunctionContext<QueryKey, TPageParam>
|
|
63
|
-
) => TFnData | Promise<TFnData>
|
|
65
|
+
fetcher: Fetcher<TFnData, TVariables, TPageParam>
|
|
64
66
|
variables?: TVariables
|
|
65
67
|
}
|
|
66
68
|
|
package/src/utils.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as TanstackReactQuery from '@tanstack/react-query'
|
|
2
2
|
import type { Query, QueryClient, QueryKey } from '@tanstack/react-query'
|
|
3
3
|
|
|
4
4
|
import type { Middleware } from './types'
|
|
5
5
|
|
|
6
|
+
export const ReactQuery = TanstackReactQuery
|
|
7
|
+
|
|
6
8
|
export const isV5 = !!ReactQuery.useSuspenseQuery
|
|
7
9
|
|
|
8
|
-
// Compatible with ReactQuery v4
|
|
9
10
|
export const suspenseOptions = {
|
|
10
11
|
enabled: true,
|
|
11
12
|
suspense: true,
|