@tanstack/query-core 5.90.8 → 5.90.10
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/legacy/{hydration-CyNNBExb.d.cts → hydration-CfvD_Kks.d.cts} +2 -2
- package/build/legacy/{hydration-DEHujg3S.d.ts → hydration-DksKBgQq.d.ts} +2 -2
- package/build/legacy/hydration.d.cts +1 -1
- package/build/legacy/hydration.d.ts +1 -1
- package/build/legacy/index.d.cts +1 -1
- package/build/legacy/index.d.ts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.ts +1 -1
- package/build/legacy/infiniteQueryObserver.d.cts +1 -1
- package/build/legacy/infiniteQueryObserver.d.ts +1 -1
- package/build/legacy/mutation.d.cts +1 -1
- package/build/legacy/mutation.d.ts +1 -1
- package/build/legacy/mutationCache.d.cts +1 -1
- package/build/legacy/mutationCache.d.ts +1 -1
- package/build/legacy/mutationObserver.d.cts +1 -1
- package/build/legacy/mutationObserver.d.ts +1 -1
- package/build/legacy/queriesObserver.d.cts +1 -1
- package/build/legacy/queriesObserver.d.ts +1 -1
- package/build/legacy/query.d.cts +1 -1
- package/build/legacy/query.d.ts +1 -1
- package/build/legacy/queryCache.d.cts +1 -1
- package/build/legacy/queryCache.d.ts +1 -1
- package/build/legacy/queryClient.d.cts +1 -1
- package/build/legacy/queryClient.d.ts +1 -1
- package/build/legacy/queryObserver.d.cts +1 -1
- package/build/legacy/queryObserver.d.ts +1 -1
- package/build/legacy/retryer.d.cts +1 -1
- package/build/legacy/retryer.d.ts +1 -1
- package/build/legacy/streamedQuery.cjs +1 -1
- package/build/legacy/streamedQuery.cjs.map +1 -1
- package/build/legacy/streamedQuery.d.cts +2 -2
- package/build/legacy/streamedQuery.d.ts +2 -2
- package/build/legacy/streamedQuery.js +1 -1
- package/build/legacy/streamedQuery.js.map +1 -1
- package/build/legacy/types.d.cts +1 -1
- package/build/legacy/types.d.ts +1 -1
- package/build/legacy/utils.cjs.map +1 -1
- package/build/legacy/utils.d.cts +1 -1
- package/build/legacy/utils.d.ts +1 -1
- package/build/legacy/utils.js.map +1 -1
- package/build/modern/{hydration-CyNNBExb.d.cts → hydration-CfvD_Kks.d.cts} +2 -2
- package/build/modern/{hydration-DEHujg3S.d.ts → hydration-DksKBgQq.d.ts} +2 -2
- package/build/modern/hydration.d.cts +1 -1
- package/build/modern/hydration.d.ts +1 -1
- package/build/modern/index.d.cts +1 -1
- package/build/modern/index.d.ts +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +1 -1
- package/build/modern/infiniteQueryBehavior.d.ts +1 -1
- package/build/modern/infiniteQueryObserver.d.cts +1 -1
- package/build/modern/infiniteQueryObserver.d.ts +1 -1
- package/build/modern/mutation.d.cts +1 -1
- package/build/modern/mutation.d.ts +1 -1
- package/build/modern/mutationCache.d.cts +1 -1
- package/build/modern/mutationCache.d.ts +1 -1
- package/build/modern/mutationObserver.d.cts +1 -1
- package/build/modern/mutationObserver.d.ts +1 -1
- package/build/modern/queriesObserver.d.cts +1 -1
- package/build/modern/queriesObserver.d.ts +1 -1
- package/build/modern/query.d.cts +1 -1
- package/build/modern/query.d.ts +1 -1
- package/build/modern/queryCache.d.cts +1 -1
- package/build/modern/queryCache.d.ts +1 -1
- package/build/modern/queryClient.d.cts +1 -1
- package/build/modern/queryClient.d.ts +1 -1
- package/build/modern/queryObserver.d.cts +1 -1
- package/build/modern/queryObserver.d.ts +1 -1
- package/build/modern/retryer.d.cts +1 -1
- package/build/modern/retryer.d.ts +1 -1
- package/build/modern/streamedQuery.cjs +1 -1
- package/build/modern/streamedQuery.cjs.map +1 -1
- package/build/modern/streamedQuery.d.cts +2 -2
- package/build/modern/streamedQuery.d.ts +2 -2
- package/build/modern/streamedQuery.js +1 -1
- package/build/modern/streamedQuery.js.map +1 -1
- package/build/modern/types.d.cts +1 -1
- package/build/modern/types.d.ts +1 -1
- package/build/modern/utils.cjs.map +1 -1
- package/build/modern/utils.d.cts +1 -1
- package/build/modern/utils.d.ts +1 -1
- package/build/modern/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/streamedQuery.ts +2 -2
- package/src/utils.ts +2 -2
package/src/streamedQuery.ts
CHANGED
|
@@ -41,7 +41,7 @@ type StreamedQueryParams<TQueryFnData, TData, TQueryKey extends QueryKey> =
|
|
|
41
41
|
* Set to `'replace'` to write all data to the cache once the stream ends.
|
|
42
42
|
* @param reducer - A function to reduce the streamed chunks into the final data.
|
|
43
43
|
* Defaults to a function that appends chunks to the end of the array.
|
|
44
|
-
* @param initialValue - Initial value to be used while the first chunk is being fetched.
|
|
44
|
+
* @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.
|
|
45
45
|
*/
|
|
46
46
|
export function streamedQuery<
|
|
47
47
|
TQueryFnData = unknown,
|
|
@@ -94,6 +94,6 @@ export function streamedQuery<
|
|
|
94
94
|
context.client.setQueryData<TData>(context.queryKey, result)
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
return context.client.getQueryData(context.queryKey)
|
|
97
|
+
return context.client.getQueryData(context.queryKey) ?? initialValue
|
|
98
98
|
}
|
|
99
99
|
}
|
package/src/utils.ts
CHANGED
|
@@ -20,7 +20,7 @@ type DropLast<T extends ReadonlyArray<unknown>> = T extends readonly [
|
|
|
20
20
|
...infer R,
|
|
21
21
|
unknown,
|
|
22
22
|
]
|
|
23
|
-
? R
|
|
23
|
+
? readonly [...R]
|
|
24
24
|
: never
|
|
25
25
|
|
|
26
26
|
type TuplePrefixes<T extends ReadonlyArray<unknown>> = T extends readonly []
|
|
@@ -43,7 +43,7 @@ export interface QueryFilters<TQueryKey extends QueryKey = QueryKey> {
|
|
|
43
43
|
/**
|
|
44
44
|
* Include queries matching this query key
|
|
45
45
|
*/
|
|
46
|
-
queryKey?: TuplePrefixes<TQueryKey>
|
|
46
|
+
queryKey?: TQueryKey | TuplePrefixes<TQueryKey>
|
|
47
47
|
/**
|
|
48
48
|
* Include or exclude stale queries
|
|
49
49
|
*/
|