Download node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js from metarm/QMetaRam: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/metarm/QMetaRam/resolve/main/node_modules/%40tanstack/react-query/build/legacy/errorBoundaryUtils.js
- Command line
-
hf download hf://metarm/QMetaRam/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js
-
curl -L -o errorBoundaryUtils.js https://huggingface.co/metarm/QMetaRam/resolve/main/node_modules/%40tanstack/react-query/build/legacy/errorBoundaryUtils.js
1.14 kB
| "use client"; | |
| import * as React from "react"; | |
| import { shouldThrowError } from "@tanstack/query-core"; | |
| //#region src/errorBoundaryUtils.ts | |
| const ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => { | |
| const throwOnError = (query === null || query === void 0 ? void 0 : query.state.error) && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError; | |
| if (options.suspense || throwOnError) { | |
| if (!errorResetBoundary.isReset()) options.retryOnMount = false; | |
| } | |
| }; | |
| const useClearResetErrorBoundary = (errorResetBoundary) => { | |
| React.useEffect(() => { | |
| errorResetBoundary.clearReset(); | |
| }, [errorResetBoundary]); | |
| }; | |
| const getHasError = ({ result, errorResetBoundary, throwOnError, query, suspense }) => { | |
| return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query])); | |
| }; | |
| //#endregion | |
| export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; | |
| //# sourceMappingURL=errorBoundaryUtils.js.map |