@tanstack/react-query 5.0.0-alpha.2 → 5.0.0-alpha.4
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/useQueries.d.ts +2 -3
- package/build/lib/useQueries.esm.js +2 -3
- package/build/lib/useQueries.esm.js.map +1 -1
- package/build/lib/useQueries.js +2 -3
- package/build/lib/useQueries.js.map +1 -1
- package/build/lib/useQueries.mjs +2 -3
- package/build/lib/useQueries.mjs.map +1 -1
- package/build/umd/index.development.js +13 -5
- 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/__tests__/useQueries.test.tsx +10 -8
- package/src/useQueries.ts +8 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-query",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.4",
|
|
4
4
|
"description": "Hooks for managing, caching and syncing asynchronous and remote data in React",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react-error-boundary": "^3.1.4"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tanstack/query-core": "5.0.0-alpha.
|
|
38
|
+
"@tanstack/query-core": "5.0.0-alpha.3"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": "^18.0.0",
|
|
@@ -914,15 +914,17 @@ describe('useQueries', () => {
|
|
|
914
914
|
}
|
|
915
915
|
|
|
916
916
|
function Page() {
|
|
917
|
-
const queries = useQueries(
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
917
|
+
const queries = useQueries(
|
|
918
|
+
{
|
|
919
|
+
queries: [
|
|
920
|
+
{
|
|
921
|
+
queryKey: key,
|
|
922
|
+
queryFn,
|
|
923
|
+
},
|
|
924
|
+
],
|
|
925
|
+
},
|
|
924
926
|
queryClient,
|
|
925
|
-
|
|
927
|
+
)
|
|
926
928
|
|
|
927
929
|
return <div>data: {queries[0].data}</div>
|
|
928
930
|
}
|
package/src/useQueries.ts
CHANGED
|
@@ -155,13 +155,14 @@ export type QueriesResults<
|
|
|
155
155
|
: // Fallback
|
|
156
156
|
UseQueryResult[]
|
|
157
157
|
|
|
158
|
-
export function useQueries<T extends any[]>(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}: {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
export function useQueries<T extends any[]>(
|
|
159
|
+
{
|
|
160
|
+
queries,
|
|
161
|
+
}: {
|
|
162
|
+
queries: readonly [...QueriesOptions<T>]
|
|
163
|
+
},
|
|
164
|
+
queryClient?: QueryClient,
|
|
165
|
+
): QueriesResults<T> {
|
|
165
166
|
const client = useQueryClient(queryClient)
|
|
166
167
|
const isRestoring = useIsRestoring()
|
|
167
168
|
|