1 line
3.6 KiB
JSON
1 line
3.6 KiB
JSON
|
{"ast":null,"code":"\"use client\";\n\n// src/errorBoundaryUtils.ts\nimport * as React from \"react\";\nimport { shouldThrowError } from \"./utils.js\";\nvar ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {\n if (options.suspense || options.throwOnError) {\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false;\n }\n }\n};\nvar useClearResetErrorBoundary = errorResetBoundary => {\n React.useEffect(() => {\n errorResetBoundary.clearReset();\n }, [errorResetBoundary]);\n};\nvar getHasError = ({\n result,\n errorResetBoundary,\n throwOnError,\n query\n}) => {\n return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]);\n};\nexport { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary };","map":{"version":3,"names":["React","shouldThrowError","ensurePreventErrorBoundaryRetry","options","errorResetBoundary","suspense","throwOnError","isReset","retryOnMount","useClearResetErrorBoundary","useEffect","clearReset","getHasError","result","query","isError","isFetching","error"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n if (options.suspense || options.throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n shouldThrowError(throwOnError, [result.error, query])\n )\n}\n"],"mappings":";;;AACA,YAAYA,KAAA,MAAW;AACvB,SAASC,gBAAA,QAAwB;AAU1B,IAAMC,+BAAA,GAAkCA,CAO7CC,OAAA,EAOAC,kBAAA,KACG;EACH,IAAID,OAAA,CAAQE,QAAA,IAAYF,OAAA,CAAQG,YAAA,EAAc;IAE5C,IAAI,CAACF,kBAAA,CAAmBG,OAAA,CAAQ,GAAG;MACjCJ,OAAA,CAAQK,YAAA,GAAe;IACzB;EACF;AACF;AAEO,IAAMC,0BAAA,GACXL,kBAAA,IACG;EACGJ,KAAA,CAAAU,SAAA,CAAU,MAAM;IACpBN,kBAAA,CAAmBO,UAAA,CAAW;EAChC,GAAG,CAACP,kBAAkB,CAAC;AACzB;AAEO,IAAMQ,WAAA,GAAcA,CAMzB;EACAC,MAAA;EACAT,kBAAA;EACAE,YAAA;EACAQ;AACF,MAKM;EACJ,OACED,MAAA,CAAOE,OAAA,IACP,CAACX,kBAAA,CAAmBG,OAAA,CAAQ,KAC5B,CAACM,MAAA,CAAOG,UAAA,IACRF,KAAA,IACAb,gBAAA,CAAiBK,YAAA,EAAc,CAACO,MAAA,CAAOI,KAAA,EAAOH,KAAK,CAAC;AAExD","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|