@tanstack/react-query
Advanced tools
Comparing version 5.65.0 to 5.65.1
@@ -8,3 +8,3 @@ import { QueryKey, DefaultedQueryObserverOptions, QueryObserverResult, ThrowOnError, Query } from '@tanstack/query-core'; | ||
declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; | ||
declare const getHasError: <TData, TError, TQueryFnData, TQueryData, TQueryKey extends QueryKey>({ result, errorResetBoundary, throwOnError, query, }: { | ||
declare const getHasError: <TData, TError, TQueryFnData, TQueryData, TQueryKey extends QueryKey>({ result, errorResetBoundary, throwOnError, query, suspense, }: { | ||
result: QueryObserverResult<TData, TError>; | ||
@@ -14,4 +14,5 @@ errorResetBoundary: QueryErrorResetBoundaryValue; | ||
query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined; | ||
suspense: boolean | undefined; | ||
}) => boolean | undefined; | ||
export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; |
@@ -22,5 +22,6 @@ "use client"; | ||
throwOnError, | ||
query | ||
query, | ||
suspense | ||
}) => { | ||
return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]); | ||
return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query])); | ||
}; | ||
@@ -27,0 +28,0 @@ export { |
@@ -73,3 +73,4 @@ "use client"; | ||
throwOnError: defaultedOptions.throwOnError, | ||
query: client.getQueryCache().get(defaultedOptions.queryHash) | ||
query: client.getQueryCache().get(defaultedOptions.queryHash), | ||
suspense: defaultedOptions.suspense | ||
})) { | ||
@@ -76,0 +77,0 @@ throw result.error; |
@@ -96,2 +96,3 @@ "use client"; | ||
(result, index) => { | ||
var _a; | ||
const query = defaultedQueries[index]; | ||
@@ -102,3 +103,4 @@ return query && getHasError({ | ||
throwOnError: query.throwOnError, | ||
query: client.getQueryCache().get(query.queryHash) | ||
query: client.getQueryCache().get(query.queryHash), | ||
suspense: (_a = defaultedQueries[index]) == null ? void 0 : _a.suspense | ||
}); | ||
@@ -105,0 +107,0 @@ } |
@@ -8,3 +8,3 @@ import { QueryKey, DefaultedQueryObserverOptions, QueryObserverResult, ThrowOnError, Query } from '@tanstack/query-core'; | ||
declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; | ||
declare const getHasError: <TData, TError, TQueryFnData, TQueryData, TQueryKey extends QueryKey>({ result, errorResetBoundary, throwOnError, query, }: { | ||
declare const getHasError: <TData, TError, TQueryFnData, TQueryData, TQueryKey extends QueryKey>({ result, errorResetBoundary, throwOnError, query, suspense, }: { | ||
result: QueryObserverResult<TData, TError>; | ||
@@ -14,4 +14,5 @@ errorResetBoundary: QueryErrorResetBoundaryValue; | ||
query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined; | ||
suspense: boolean | undefined; | ||
}) => boolean | undefined; | ||
export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; |
@@ -22,5 +22,6 @@ "use client"; | ||
throwOnError, | ||
query | ||
query, | ||
suspense | ||
}) => { | ||
return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]); | ||
return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query])); | ||
}; | ||
@@ -27,0 +28,0 @@ export { |
@@ -71,3 +71,4 @@ "use client"; | ||
throwOnError: defaultedOptions.throwOnError, | ||
query: client.getQueryCache().get(defaultedOptions.queryHash) | ||
query: client.getQueryCache().get(defaultedOptions.queryHash), | ||
suspense: defaultedOptions.suspense | ||
})) { | ||
@@ -74,0 +75,0 @@ throw result.error; |
@@ -101,3 +101,4 @@ "use client"; | ||
throwOnError: query.throwOnError, | ||
query: client.getQueryCache().get(query.queryHash) | ||
query: client.getQueryCache().get(query.queryHash), | ||
suspense: defaultedQueries[index]?.suspense | ||
}); | ||
@@ -104,0 +105,0 @@ } |
{ | ||
"name": "@tanstack/react-query", | ||
"version": "5.65.0", | ||
"version": "5.65.1", | ||
"description": "Hooks for managing, caching and syncing asynchronous and remote data in React", | ||
@@ -5,0 +5,0 @@ "author": "tannerlinsley", |
@@ -60,2 +60,3 @@ 'use client' | ||
query, | ||
suspense, | ||
}: { | ||
@@ -66,2 +67,3 @@ result: QueryObserverResult<TData, TError> | ||
query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined | ||
suspense: boolean | undefined | ||
}) => { | ||
@@ -73,4 +75,5 @@ return ( | ||
query && | ||
shouldThrowError(throwOnError, [result.error, query]) | ||
((suspense && result.data === undefined) || | ||
shouldThrowError(throwOnError, [result.error, query])) | ||
) | ||
} |
@@ -133,2 +133,3 @@ 'use client' | ||
>(defaultedOptions.queryHash), | ||
suspense: defaultedOptions.suspense, | ||
}) | ||
@@ -135,0 +136,0 @@ ) { |
@@ -340,2 +340,3 @@ 'use client' | ||
query: client.getQueryCache().get(query.queryHash), | ||
suspense: defaultedQueries[index]?.suspense, | ||
}) | ||
@@ -342,0 +343,0 @@ ) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
721367
8737
4
12
131