@tanstack/react-query 5.0.0-alpha.0 → 5.0.0-alpha.1
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/useInfiniteQuery.esm.js +3 -1
- package/build/lib/useInfiniteQuery.esm.js.map +1 -1
- package/build/lib/useInfiniteQuery.js +3 -1
- package/build/lib/useInfiniteQuery.js.map +1 -1
- package/build/lib/useInfiniteQuery.mjs +3 -1
- package/build/lib/useInfiniteQuery.mjs.map +1 -1
- package/build/umd/index.development.js +4 -4
- 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/useInfiniteQuery.ts +1 -0
|
@@ -3,7 +3,9 @@ import { useBaseQuery } from './useBaseQuery.esm.js';
|
|
|
3
3
|
|
|
4
4
|
// HOOK
|
|
5
5
|
function useInfiniteQuery(options, queryClient) {
|
|
6
|
-
return useBaseQuery(options,
|
|
6
|
+
return useBaseQuery(options,
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
8
|
+
InfiniteQueryObserver, queryClient);
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
export { useInfiniteQuery };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfiniteQuery.esm.js","sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import type {\n QueryObserver,\n QueryKey,\n QueryClient,\n RegisteredError,\n InfiniteData,\n} from '@tanstack/query-core'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types'\nimport { useBaseQuery } from './useBaseQuery'\n\n// HOOK\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = RegisteredError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult<TData, TError> {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as UseInfiniteQueryResult<TData, TError>\n}\n"],"names":["useInfiniteQuery","options","queryClient","useBaseQuery","InfiniteQueryObserver"],"mappings":";;;AAWA;AACO,SAASA,gBAAgB,CAO9BC,OAOC,EACDC,WAAyB,EACc;
|
|
1
|
+
{"version":3,"file":"useInfiniteQuery.esm.js","sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import type {\n QueryObserver,\n QueryKey,\n QueryClient,\n RegisteredError,\n InfiniteData,\n} from '@tanstack/query-core'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types'\nimport { useBaseQuery } from './useBaseQuery'\n\n// HOOK\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = RegisteredError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult<TData, TError> {\n return useBaseQuery(\n options,\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as UseInfiniteQueryResult<TData, TError>\n}\n"],"names":["useInfiniteQuery","options","queryClient","useBaseQuery","InfiniteQueryObserver"],"mappings":";;;AAWA;AACO,SAASA,gBAAgB,CAO9BC,OAOC,EACDC,WAAyB,EACc;EACvC,OAAOC,YAAY,CACjBF,OAAO;AACP;EACAG,qBAAqB,EACrBF,WAAW,CACZ,CAAA;AACH;;;;"}
|
|
@@ -5,7 +5,9 @@ var useBaseQuery = require('./useBaseQuery.js');
|
|
|
5
5
|
|
|
6
6
|
// HOOK
|
|
7
7
|
function useInfiniteQuery(options, queryClient) {
|
|
8
|
-
return useBaseQuery.useBaseQuery(options,
|
|
8
|
+
return useBaseQuery.useBaseQuery(options,
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
10
|
+
queryCore.InfiniteQueryObserver, queryClient);
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
exports.useInfiniteQuery = useInfiniteQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfiniteQuery.js","sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import type {\n QueryObserver,\n QueryKey,\n QueryClient,\n RegisteredError,\n InfiniteData,\n} from '@tanstack/query-core'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types'\nimport { useBaseQuery } from './useBaseQuery'\n\n// HOOK\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = RegisteredError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult<TData, TError> {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as UseInfiniteQueryResult<TData, TError>\n}\n"],"names":["useInfiniteQuery","options","queryClient","useBaseQuery","InfiniteQueryObserver"],"mappings":";;;;;AAWA;AACO,SAASA,gBAAgB,CAO9BC,OAOC,EACDC,WAAyB,EACc;
|
|
1
|
+
{"version":3,"file":"useInfiniteQuery.js","sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import type {\n QueryObserver,\n QueryKey,\n QueryClient,\n RegisteredError,\n InfiniteData,\n} from '@tanstack/query-core'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types'\nimport { useBaseQuery } from './useBaseQuery'\n\n// HOOK\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = RegisteredError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult<TData, TError> {\n return useBaseQuery(\n options,\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as UseInfiniteQueryResult<TData, TError>\n}\n"],"names":["useInfiniteQuery","options","queryClient","useBaseQuery","InfiniteQueryObserver"],"mappings":";;;;;AAWA;AACO,SAASA,gBAAgB,CAO9BC,OAOC,EACDC,WAAyB,EACc;EACvC,OAAOC,yBAAY,CACjBF,OAAO;AACP;EACAG,+BAAqB,EACrBF,WAAW,CACZ,CAAA;AACH;;;;"}
|
|
@@ -3,7 +3,9 @@ import { useBaseQuery } from './useBaseQuery.mjs';
|
|
|
3
3
|
|
|
4
4
|
// HOOK
|
|
5
5
|
function useInfiniteQuery(options, queryClient) {
|
|
6
|
-
return useBaseQuery(options,
|
|
6
|
+
return useBaseQuery(options,
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
8
|
+
InfiniteQueryObserver, queryClient);
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
export { useInfiniteQuery };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfiniteQuery.mjs","sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import type {\n QueryObserver,\n QueryKey,\n QueryClient,\n RegisteredError,\n InfiniteData,\n} from '@tanstack/query-core'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types'\nimport { useBaseQuery } from './useBaseQuery'\n\n// HOOK\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = RegisteredError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult<TData, TError> {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as UseInfiniteQueryResult<TData, TError>\n}\n"],"names":["useInfiniteQuery","options","queryClient","useBaseQuery","InfiniteQueryObserver"],"mappings":";;;AAWA;AACO,SAASA,gBAAgB,CAO9BC,OAOC,EACDC,WAAyB,EACc;
|
|
1
|
+
{"version":3,"file":"useInfiniteQuery.mjs","sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import type {\n QueryObserver,\n QueryKey,\n QueryClient,\n RegisteredError,\n InfiniteData,\n} from '@tanstack/query-core'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types'\nimport { useBaseQuery } from './useBaseQuery'\n\n// HOOK\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = RegisteredError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult<TData, TError> {\n return useBaseQuery(\n options,\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as UseInfiniteQueryResult<TData, TError>\n}\n"],"names":["useInfiniteQuery","options","queryClient","useBaseQuery","InfiniteQueryObserver"],"mappings":";;;AAWA;AACO,SAASA,gBAAgB,CAO9BC,OAOC,EACDC,WAAyB,EACc;EACvC,OAAOC,YAAY,CACjBF,OAAO;AACP;EACAG,qBAAqB,EACrBF,WAAW,CACZ,CAAA;AACH;;;;"}
|
|
@@ -2529,9 +2529,7 @@
|
|
|
2529
2529
|
mutate(variables, options) {
|
|
2530
2530
|
this.#mutateOptions = options;
|
|
2531
2531
|
this.#currentMutation?.removeObserver(this);
|
|
2532
|
-
this.#currentMutation = this.#client.getMutationCache().build(this.#client,
|
|
2533
|
-
...this.options
|
|
2534
|
-
});
|
|
2532
|
+
this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options);
|
|
2535
2533
|
this.#currentMutation.addObserver(this);
|
|
2536
2534
|
return this.#currentMutation.execute(variables);
|
|
2537
2535
|
}
|
|
@@ -2983,7 +2981,9 @@
|
|
|
2983
2981
|
|
|
2984
2982
|
// HOOK
|
|
2985
2983
|
function useInfiniteQuery(options, queryClient) {
|
|
2986
|
-
return useBaseQuery(options,
|
|
2984
|
+
return useBaseQuery(options,
|
|
2985
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
2986
|
+
InfiniteQueryObserver, queryClient);
|
|
2987
2987
|
}
|
|
2988
2988
|
|
|
2989
2989
|
exports.CancelledError = CancelledError;
|