@tanstack/react-query 4.1.3 → 4.3.0-beta.1

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.
Files changed (103) hide show
  1. package/build/{types/packages/react-query/src → lib}/Hydrate.d.ts +0 -0
  2. package/build/{types/packages/react-query/src → lib}/QueryClientProvider.d.ts +0 -0
  3. package/build/{types/packages/react-query/src → lib}/QueryErrorResetBoundary.d.ts +0 -0
  4. package/build/{types/packages/react-query/src → lib}/index.d.ts +0 -0
  5. package/build/lib/index.js +625 -0
  6. package/build/lib/index.js.map +1 -0
  7. package/build/lib/index.mjs +579 -0
  8. package/build/lib/index.mjs.map +1 -0
  9. package/build/{types/packages/react-query/src → lib}/isRestoring.d.ts +0 -0
  10. package/build/{types/packages/react-query/src → lib}/reactBatchedUpdates.d.ts +0 -0
  11. package/build/{types/packages/react-query/src → lib}/reactBatchedUpdates.native.d.ts +0 -0
  12. package/build/{types/packages/react-query/src → lib}/setBatchUpdatesFn.d.ts +0 -0
  13. package/build/{types/packages/react-query/src → lib}/types.d.ts +0 -0
  14. package/build/{types/packages/react-query/src → lib}/useBaseQuery.d.ts +0 -0
  15. package/build/{types/packages/react-query/src → lib}/useInfiniteQuery.d.ts +0 -0
  16. package/build/{types/packages/react-query/src → lib}/useIsFetching.d.ts +0 -0
  17. package/build/{types/packages/react-query/src → lib}/useIsMutating.d.ts +0 -0
  18. package/build/{types/packages/react-query/src → lib}/useMutation.d.ts +0 -0
  19. package/build/{types/packages/react-query/src → lib}/useQueries.d.ts +0 -0
  20. package/build/{types/packages/react-query/src → lib}/useQuery.d.ts +0 -0
  21. package/build/lib/useSyncExternalStore.d.ts +1 -0
  22. package/build/lib/useSyncExternalStore.native.d.ts +1 -0
  23. package/build/{types/packages/react-query/src → lib}/utils.d.ts +0 -0
  24. package/build/umd/index.development.js +274 -9
  25. package/build/umd/index.development.js.map +1 -1
  26. package/build/umd/index.production.js +3 -2
  27. package/build/umd/index.production.js.map +1 -1
  28. package/package.json +17 -15
  29. package/src/useBaseQuery.ts +1 -1
  30. package/src/useIsFetching.ts +1 -1
  31. package/src/useIsMutating.ts +1 -1
  32. package/src/useMutation.ts +1 -1
  33. package/src/useQueries.ts +1 -1
  34. package/src/useSyncExternalStore.native.ts +3 -0
  35. package/src/useSyncExternalStore.ts +2 -0
  36. package/build/cjs/query-core/build/esm/index.js +0 -3123
  37. package/build/cjs/query-core/build/esm/index.js.map +0 -1
  38. package/build/cjs/react-query/src/Hydrate.js +0 -66
  39. package/build/cjs/react-query/src/Hydrate.js.map +0 -1
  40. package/build/cjs/react-query/src/QueryClientProvider.js +0 -96
  41. package/build/cjs/react-query/src/QueryClientProvider.js.map +0 -1
  42. package/build/cjs/react-query/src/QueryErrorResetBoundary.js +0 -67
  43. package/build/cjs/react-query/src/QueryErrorResetBoundary.js.map +0 -1
  44. package/build/cjs/react-query/src/index.js +0 -64
  45. package/build/cjs/react-query/src/index.js.map +0 -1
  46. package/build/cjs/react-query/src/isRestoring.js +0 -43
  47. package/build/cjs/react-query/src/isRestoring.js.map +0 -1
  48. package/build/cjs/react-query/src/useBaseQuery.js +0 -117
  49. package/build/cjs/react-query/src/useBaseQuery.js.map +0 -1
  50. package/build/cjs/react-query/src/useInfiniteQuery.js +0 -24
  51. package/build/cjs/react-query/src/useInfiniteQuery.js.map +0 -1
  52. package/build/cjs/react-query/src/useIsFetching.js +0 -50
  53. package/build/cjs/react-query/src/useIsFetching.js.map +0 -1
  54. package/build/cjs/react-query/src/useIsMutating.js +0 -50
  55. package/build/cjs/react-query/src/useIsMutating.js.map +0 -1
  56. package/build/cjs/react-query/src/useMutation.js +0 -68
  57. package/build/cjs/react-query/src/useMutation.js.map +0 -1
  58. package/build/cjs/react-query/src/useQueries.js +0 -71
  59. package/build/cjs/react-query/src/useQueries.js.map +0 -1
  60. package/build/cjs/react-query/src/useQuery.js +0 -24
  61. package/build/cjs/react-query/src/useQuery.js.map +0 -1
  62. package/build/cjs/react-query/src/utils.js +0 -25
  63. package/build/cjs/react-query/src/utils.js.map +0 -1
  64. package/build/esm/index.js +0 -3381
  65. package/build/esm/index.js.map +0 -1
  66. package/build/stats-html.html +0 -2689
  67. package/build/stats.json +0 -666
  68. package/build/types/packages/query-core/src/focusManager.d.ts +0 -16
  69. package/build/types/packages/query-core/src/hydration.d.ts +0 -34
  70. package/build/types/packages/query-core/src/index.d.ts +0 -20
  71. package/build/types/packages/query-core/src/infiniteQueryBehavior.d.ts +0 -15
  72. package/build/types/packages/query-core/src/infiniteQueryObserver.d.ts +0 -18
  73. package/build/types/packages/query-core/src/logger.d.ts +0 -8
  74. package/build/types/packages/query-core/src/mutation.d.ts +0 -70
  75. package/build/types/packages/query-core/src/mutationCache.d.ts +0 -57
  76. package/build/types/packages/query-core/src/mutationObserver.d.ts +0 -23
  77. package/build/types/packages/query-core/src/notifyManager.d.ts +0 -18
  78. package/build/types/packages/query-core/src/onlineManager.d.ts +0 -16
  79. package/build/types/packages/query-core/src/queriesObserver.d.ts +0 -23
  80. package/build/types/packages/query-core/src/query.d.ts +0 -119
  81. package/build/types/packages/query-core/src/queryCache.d.ts +0 -64
  82. package/build/types/packages/query-core/src/queryClient.d.ts +0 -65
  83. package/build/types/packages/query-core/src/queryObserver.d.ts +0 -61
  84. package/build/types/packages/query-core/src/removable.d.ts +0 -9
  85. package/build/types/packages/query-core/src/retryer.d.ts +0 -33
  86. package/build/types/packages/query-core/src/subscribable.d.ts +0 -10
  87. package/build/types/packages/query-core/src/types.d.ts +0 -418
  88. package/build/types/packages/query-core/src/utils.d.ts +0 -99
  89. package/build/types/packages/react-query/src/__tests__/Hydrate.test.d.ts +0 -1
  90. package/build/types/packages/react-query/src/__tests__/QueryClientProvider.test.d.ts +0 -1
  91. package/build/types/packages/react-query/src/__tests__/QueryResetErrorBoundary.test.d.ts +0 -6
  92. package/build/types/packages/react-query/src/__tests__/ssr-hydration.test.d.ts +0 -1
  93. package/build/types/packages/react-query/src/__tests__/ssr.test.d.ts +0 -4
  94. package/build/types/packages/react-query/src/__tests__/suspense.test.d.ts +0 -1
  95. package/build/types/packages/react-query/src/__tests__/useInfiniteQuery.test.d.ts +0 -1
  96. package/build/types/packages/react-query/src/__tests__/useIsFetching.test.d.ts +0 -1
  97. package/build/types/packages/react-query/src/__tests__/useIsMutating.test.d.ts +0 -1
  98. package/build/types/packages/react-query/src/__tests__/useMutation.test.d.ts +0 -1
  99. package/build/types/packages/react-query/src/__tests__/useQueries.test.d.ts +0 -1
  100. package/build/types/packages/react-query/src/__tests__/useQuery.test.d.ts +0 -1
  101. package/build/types/packages/react-query/src/__tests__/useQuery.types.test.d.ts +0 -2
  102. package/build/types/packages/react-query/src/__tests__/utils.d.ts +0 -8
  103. package/build/types/tests/utils.d.ts +0 -24
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../src/reactBatchedUpdates.ts","../../src/setBatchUpdatesFn.ts","../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js","../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../../../../node_modules/use-sync-external-store/shim/index.js","../../src/QueryClientProvider.tsx","../../src/isRestoring.tsx","../../src/useQueries.ts","../../src/QueryErrorResetBoundary.tsx","../../src/utils.ts","../../src/useBaseQuery.ts","../../src/useQuery.ts","../../src/Hydrate.tsx","../../src/useIsFetching.ts","../../src/useIsMutating.ts","../../src/useMutation.ts","../../src/useInfiniteQuery.ts"],"sourcesContent":["import * as ReactDOM from 'react-dom'\nexport const unstable_batchedUpdates = ReactDOM.unstable_batchedUpdates\n","import { notifyManager } from '@tanstack/query-core'\nimport { unstable_batchedUpdates } from './reactBatchedUpdates'\n\nnotifyManager.setBatchNotifyFunction(unstable_batchedUpdates)\n","/**\n * @license React\n * use-sync-external-store-shim.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var e=require(\"react\");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k=\"function\"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d}\nfunction r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u=\"undefined\"===typeof window||\"undefined\"===typeof window.document||\"undefined\"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;\n","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var React = require('react');\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n}\n\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\n\n// dispatch for CommonJS interop named imports.\n\nvar useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nvar didWarnOld18Alpha = false;\nvar didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works\n// because of a very particular set of implementation details and assumptions\n// -- change any one of them and it will break. The most important assumption\n// is that updates are always synchronous, because concurrent rendering is\n// only available in versions of React that also have a built-in\n// useSyncExternalStore API. And we only use this shim when the built-in API\n// does not exist.\n//\n// Do not assume that the clever hacks used by this hook also work in general.\n// The point of this shim is to replace the need for hacks by other libraries.\n\nfunction useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n// React do not expose a way to check if we're hydrating. So users of the shim\n// will need to track that themselves and return the correct value\n// from `getSnapshot`.\ngetServerSnapshot) {\n {\n if (!didWarnOld18Alpha) {\n if (React.startTransition !== undefined) {\n didWarnOld18Alpha = true;\n\n error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');\n }\n }\n } // Read the current snapshot from the store on every render. Again, this\n // breaks the rules of React, and only works here because of specific\n // implementation details, most importantly that updates are\n // always synchronous.\n\n\n var value = getSnapshot();\n\n {\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n\n if (!objectIs(value, cachedValue)) {\n error('The result of getSnapshot should be cached to avoid an infinite loop');\n\n didWarnUncachedGetSnapshot = true;\n }\n }\n } // Because updates are synchronous, we don't queue them. Instead we force a\n // re-render whenever the subscribed state changes by updating an some\n // arbitrary useState hook. Then, during render, we call getSnapshot to read\n // the current value.\n //\n // Because we don't actually use the state returned by the useState hook, we\n // can save a bit of memory by storing other stuff in that slot.\n //\n // To implement the early bailout, we need to track some things on a mutable\n // object. Usually, we would put that in a useRef hook, but we can stash it in\n // our useState hook instead.\n //\n // To force a re-render, we call forceUpdate({inst}). That works because the\n // new object always fails an equality check.\n\n\n var _useState = useState({\n inst: {\n value: value,\n getSnapshot: getSnapshot\n }\n }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated\n // in the layout phase so we can access it during the tearing check that\n // happens on subscribe.\n\n\n useLayoutEffect(function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the\n // commit phase if there was an interleaved mutation. In concurrent mode\n // this can happen all the time, but even in synchronous mode, an earlier\n // effect may have mutated the store.\n\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst: inst\n });\n }\n }, [subscribe, value, getSnapshot]);\n useEffect(function () {\n // Check for changes right before subscribing. Subsequent changes will be\n // detected in the subscription handler.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst: inst\n });\n }\n\n var handleStoreChange = function () {\n // TODO: Because there is no cross-renderer API for batching updates, it's\n // up to the consumer of this library to wrap their subscription event\n // with unstable_batchedUpdates. Should we try to detect when this isn't\n // the case and print a warning in development?\n // The store changed. Check if the snapshot changed since the last time we\n // read from the store.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst: inst\n });\n }\n }; // Subscribe to the store and return a clean-up function.\n\n\n return subscribe(handleStoreChange);\n }, [subscribe]);\n useDebugValue(value);\n return value;\n}\n\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n var prevValue = inst.value;\n\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(prevValue, nextValue);\n } catch (error) {\n return true;\n }\n}\n\nfunction useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {\n // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n // React do not expose a way to check if we're hydrating. So users of the shim\n // will need to track that themselves and return the correct value\n // from `getSnapshot`.\n return getSnapshot();\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\n\nvar isServerEnvironment = !canUseDOM;\n\nvar shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;\nvar useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;\n\nexports.useSyncExternalStore = useSyncExternalStore$2;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","import * as React from 'react'\n\nimport { QueryClient } from '@tanstack/query-core'\nimport { ContextOptions } from './types'\n\ndeclare global {\n interface Window {\n ReactQueryClientContext?: React.Context<QueryClient | undefined>\n }\n}\n\nexport const defaultContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\nconst QueryClientSharingContext = React.createContext<boolean>(false)\n\n// If we are given a context, we will use it.\n// Otherwise, if contextSharing is on, we share the first and at least one\n// instance of the context across the window\n// to ensure that if React Query is used across\n// different bundles or microfrontends they will\n// all use the same **instance** of context, regardless\n// of module scoping.\nfunction getQueryClientContext(\n context: React.Context<QueryClient | undefined> | undefined,\n contextSharing: boolean,\n) {\n if (context) {\n return context\n }\n if (contextSharing && typeof window !== 'undefined') {\n if (!window.ReactQueryClientContext) {\n window.ReactQueryClientContext = defaultContext\n }\n\n return window.ReactQueryClientContext\n }\n\n return defaultContext\n}\n\nexport const useQueryClient = ({ context }: ContextOptions = {}) => {\n const queryClient = React.useContext(\n getQueryClientContext(context, React.useContext(QueryClientSharingContext)),\n )\n\n if (!queryClient) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return queryClient\n}\n\ntype QueryClientProviderPropsBase = {\n client: QueryClient\n children?: React.ReactNode\n}\ntype QueryClientProviderPropsWithContext = ContextOptions & {\n contextSharing?: never\n} & QueryClientProviderPropsBase\ntype QueryClientProviderPropsWithContextSharing = {\n context?: never\n contextSharing?: boolean\n} & QueryClientProviderPropsBase\n\nexport type QueryClientProviderProps =\n | QueryClientProviderPropsWithContext\n | QueryClientProviderPropsWithContextSharing\n\nexport const QueryClientProvider = ({\n client,\n children,\n context,\n contextSharing = false,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n const Context = getQueryClientContext(context, contextSharing)\n\n return (\n <QueryClientSharingContext.Provider value={!context && contextSharing}>\n <Context.Provider value={client}>{children}</Context.Provider>\n </QueryClientSharingContext.Provider>\n )\n}\n","import * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n","import * as React from 'react'\nimport { useSyncExternalStore } from './useSyncExternalStore'\n\nimport {\n QueryKey,\n QueryFunction,\n notifyManager,\n QueriesObserver,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { UseQueryOptions, UseQueryResult } from './types'\nimport { useIsRestoring } from './isRestoring'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// - `context` is omitted as it is passed as a root-level option to `useQueries` instead.\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'context'>\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\ntype GetOptions<T> =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries<TQueryFnData, TError, TData>\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries<TQueryFnData, TError>\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries<unknown, TError, TData>\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries<TQueryFnData, TError, TData>\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries<TQueryFnData, TError>\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries<TQueryFnData>\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?: QueryFunction<infer TQueryFnData, infer TQueryKey>\n select: (data: any) => infer TData\n }\n ? UseQueryOptionsForUseQueries<TQueryFnData, unknown, TData, TQueryKey>\n : T extends { queryFn?: QueryFunction<infer TQueryFnData, infer TQueryKey> }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\ntype GetResults<T> =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseQueryResult<TData, TError>\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryResult<TQueryFnData, TError>\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryResult<TData, TError>\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseQueryResult<TData, TError>\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryResult<TQueryFnData, TError>\n : T extends [infer TQueryFnData]\n ? UseQueryResult<TQueryFnData>\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?: QueryFunction<unknown, any>\n select: (data: any) => infer TData\n }\n ? UseQueryResult<TData>\n : T extends { queryFn?: QueryFunction<infer TQueryFnData, any> }\n ? UseQueryResult<TQueryFnData>\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends any[],\n Result extends any[] = [],\n Depth extends ReadonlyArray<number> = [],\n> = Depth['length'] extends MAXIMUM_DEPTH\n ? UseQueryOptionsForUseQueries[]\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...Result, GetOptions<Head>]\n : T extends [infer Head, ...infer Tail]\n ? QueriesOptions<[...Tail], [...Result, GetOptions<Head>], [...Depth, 1]>\n : unknown[] extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >[]\n ? UseQueryOptionsForUseQueries<TQueryFnData, TError, TData, TQueryKey>[]\n : // Fallback\n UseQueryOptionsForUseQueries[]\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends any[],\n Result extends any[] = [],\n Depth extends ReadonlyArray<number> = [],\n> = Depth['length'] extends MAXIMUM_DEPTH\n ? UseQueryResult[]\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...Result, GetResults<Head>]\n : T extends [infer Head, ...infer Tail]\n ? QueriesResults<[...Tail], [...Result, GetResults<Head>], [...Depth, 1]>\n : T extends UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n any\n >[]\n ? // Dynamic-size (homogenous) UseQueryOptions array: map directly to array of results\n UseQueryResult<unknown extends TData ? TQueryFnData : TData, TError>[]\n : // Fallback\n UseQueryResult[]\n\nexport function useQueries<T extends any[]>({\n queries,\n context,\n}: {\n queries: readonly [...QueriesOptions<T>]\n context?: UseQueryOptions['context']\n}): QueriesResults<T> {\n const queryClient = useQueryClient({ context })\n const isRestoring = useIsRestoring()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((options) => {\n const defaultedOptions = queryClient.defaultQueryOptions(options)\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, queryClient, isRestoring],\n )\n\n const [observer] = React.useState(\n () => new QueriesObserver(queryClient, defaultedQueries),\n )\n\n const result = observer.getOptimisticResult(defaultedQueries)\n\n useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n isRestoring\n ? () => undefined\n : observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer, isRestoring],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n // Do not notify on updates because of changes in the options because\n // these changes should already be reflected in the optimistic result.\n observer.setQueries(defaultedQueries, { listeners: false })\n }, [defaultedQueries, observer])\n\n return result as QueriesResults<T>\n}\n","import * as React from 'react'\n\n// CONTEXT\n\ninterface QueryErrorResetBoundaryValue {\n clearReset: () => void\n isReset: () => boolean\n reset: () => void\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport interface QueryErrorResetBoundaryProps {\n children:\n | ((value: QueryErrorResetBoundaryValue) => React.ReactNode)\n | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n <QueryErrorResetBoundaryContext.Provider value={value}>\n {typeof children === 'function'\n ? (children as Function)(value)\n : children}\n </QueryErrorResetBoundaryContext.Provider>\n )\n}\n","export function shouldThrowError<T extends (...args: any[]) => boolean>(\n _useErrorBoundary: boolean | T | undefined,\n params: Parameters<T>,\n): boolean {\n // Allow useErrorBoundary function to override throwing behavior on a per-error basis\n if (typeof _useErrorBoundary === 'function') {\n return _useErrorBoundary(...params)\n }\n\n return !!_useErrorBoundary\n}\n","import * as React from 'react'\nimport { useSyncExternalStore } from './useSyncExternalStore'\n\nimport { QueryKey, notifyManager, QueryObserver } from '@tanstack/query-core'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport { useQueryClient } from './QueryClientProvider'\nimport { UseBaseQueryOptions } from './types'\nimport { shouldThrowError } from './utils'\nimport { useIsRestoring } from './isRestoring'\n\nexport function useBaseQuery<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: UseBaseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n Observer: typeof QueryObserver,\n) {\n const queryClient = useQueryClient({ context: options.context })\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const defaultedOptions = queryClient.defaultQueryOptions(options)\n\n // Make sure results are optimistically set in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n // Include callbacks in batch renders\n if (defaultedOptions.onError) {\n defaultedOptions.onError = notifyManager.batchCalls(\n defaultedOptions.onError,\n )\n }\n\n if (defaultedOptions.onSuccess) {\n defaultedOptions.onSuccess = notifyManager.batchCalls(\n defaultedOptions.onSuccess,\n )\n }\n\n if (defaultedOptions.onSettled) {\n defaultedOptions.onSettled = notifyManager.batchCalls(\n defaultedOptions.onSettled,\n )\n }\n\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (typeof defaultedOptions.staleTime !== 'number') {\n defaultedOptions.staleTime = 1000\n }\n }\n\n if (defaultedOptions.suspense || defaultedOptions.useErrorBoundary) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n defaultedOptions.retryOnMount = false\n }\n }\n\n const [observer] = React.useState(\n () =>\n new Observer<TQueryFnData, TError, TData, TQueryData, TQueryKey>(\n queryClient,\n defaultedOptions,\n ),\n )\n\n const result = observer.getOptimisticResult(defaultedOptions)\n\n useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n isRestoring\n ? () => undefined\n : observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer, isRestoring],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n\n React.useEffect(() => {\n // Do not notify on updates because of changes in the options because\n // these changes should already be reflected in the optimistic result.\n observer.setOptions(defaultedOptions, { listeners: false })\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (\n defaultedOptions.suspense &&\n result.isLoading &&\n result.isFetching &&\n !isRestoring\n ) {\n throw observer\n .fetchOptimistic(defaultedOptions)\n .then(({ data }) => {\n defaultedOptions.onSuccess?.(data as TData)\n defaultedOptions.onSettled?.(data, null)\n })\n .catch((error) => {\n errorResetBoundary.clearReset()\n defaultedOptions.onError?.(error)\n defaultedOptions.onSettled?.(undefined, error)\n })\n }\n\n // Handle error boundary\n if (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n shouldThrowError(defaultedOptions.useErrorBoundary, [\n result.error,\n observer.getCurrentQuery(),\n ])\n ) {\n throw result.error\n }\n\n // Handle result property usage tracking\n return !defaultedOptions.notifyOnChangeProps\n ? observer.trackResult(result)\n : result\n}\n","import {\n parseQueryArgs,\n QueryFunction,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport { DefinedUseQueryResult, UseQueryOptions, UseQueryResult } from './types'\nimport { useBaseQuery } from './useBaseQuery'\n\n// HOOK\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: Omit<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'initialData'\n > & { initialData?: () => undefined },\n): UseQueryResult<TData, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: Omit<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'initialData'\n > & { initialData: TQueryFnData | (() => TQueryFnData) },\n): DefinedUseQueryResult<TData, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n): UseQueryResult<TData, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n options?: Omit<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryKey' | 'initialData'\n > & { initialData?: () => undefined },\n): UseQueryResult<TData, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n options?: Omit<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryKey' | 'initialData'\n > & { initialData: TQueryFnData | (() => TQueryFnData) },\n): DefinedUseQueryResult<TData, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n options?: Omit<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryKey'\n >,\n): UseQueryResult<TData, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n queryFn: QueryFunction<TQueryFnData, TQueryKey>,\n options?: Omit<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryKey' | 'queryFn' | 'initialData'\n > & { initialData?: () => undefined },\n): UseQueryResult<TData, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n queryFn: QueryFunction<TQueryFnData, TQueryKey>,\n options?: Omit<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryKey' | 'queryFn' | 'initialData'\n > & { initialData: TQueryFnData | (() => TQueryFnData) },\n): DefinedUseQueryResult<TData, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n queryFn: QueryFunction<TQueryFnData, TQueryKey>,\n options?: Omit<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryKey' | 'queryFn'\n >,\n): UseQueryResult<TData, TError>\n\nexport function useQuery<\n TQueryFnData,\n TError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n arg1: TQueryKey | UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n arg2?:\n | QueryFunction<TQueryFnData, TQueryKey>\n | UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n arg3?: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n): UseQueryResult<TData, TError> {\n const parsedOptions = parseQueryArgs(arg1, arg2, arg3)\n return useBaseQuery(parsedOptions, QueryObserver)\n}\n","import * as React from 'react'\n\nimport { hydrate, HydrateOptions } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { ContextOptions } from './types'\n\nexport function useHydrate(\n state: unknown,\n options: HydrateOptions & ContextOptions = {},\n) {\n const queryClient = useQueryClient({ context: options.context })\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // Running hydrate again with the same queries is safe,\n // it wont overwrite or initialize existing queries,\n // relying on useMemo here is only a performance optimization.\n // hydrate can and should be run *during* render here for SSR to work properly\n React.useMemo(() => {\n if (state) {\n hydrate(queryClient, state, optionsRef.current)\n }\n }, [queryClient, state])\n}\n\nexport interface HydrateProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n}\n\nexport const Hydrate = ({ children, options, state }: HydrateProps) => {\n useHydrate(state, options)\n return children as React.ReactElement\n}\n","import * as React from 'react'\nimport {\n QueryKey,\n notifyManager,\n parseFilterArgs,\n QueryFilters,\n} from '@tanstack/query-core'\n\nimport { useSyncExternalStore } from './useSyncExternalStore'\nimport { ContextOptions } from './types'\nimport { useQueryClient } from './QueryClientProvider'\n\ninterface Options extends ContextOptions {}\n\nexport function useIsFetching(filters?: QueryFilters, options?: Options): number\nexport function useIsFetching(\n queryKey?: QueryKey,\n filters?: QueryFilters,\n options?: Options,\n): number\nexport function useIsFetching(\n arg1?: QueryKey | QueryFilters,\n arg2?: QueryFilters | Options,\n arg3?: Options,\n): number {\n const [filters, options = {}] = parseFilterArgs(arg1, arg2, arg3)\n const queryClient = useQueryClient({ context: options.context })\n const queryCache = queryClient.getQueryCache()\n\n return useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => queryClient.isFetching(filters),\n () => queryClient.isFetching(filters),\n )\n}\n","import * as React from 'react'\nimport { useSyncExternalStore } from './useSyncExternalStore'\n\nimport {\n notifyManager,\n MutationKey,\n MutationFilters,\n parseMutationFilterArgs,\n} from '@tanstack/query-core'\nimport { ContextOptions } from './types'\nimport { useQueryClient } from './QueryClientProvider'\n\ninterface Options extends ContextOptions {}\n\nexport function useIsMutating(\n filters?: MutationFilters,\n options?: Options,\n): number\nexport function useIsMutating(\n mutationKey?: MutationKey,\n filters?: Omit<MutationFilters, 'mutationKey'>,\n options?: Options,\n): number\nexport function useIsMutating(\n arg1?: MutationKey | MutationFilters,\n arg2?: Omit<MutationFilters, 'mutationKey'> | Options,\n arg3?: Options,\n): number {\n const [filters, options = {}] = parseMutationFilterArgs(arg1, arg2, arg3)\n\n const queryClient = useQueryClient({ context: options.context })\n const mutationCache = queryClient.getMutationCache()\n\n return useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [mutationCache],\n ),\n () => queryClient.isMutating(filters),\n () => queryClient.isMutating(filters),\n )\n}\n","import * as React from 'react'\nimport { useSyncExternalStore } from './useSyncExternalStore'\n\nimport {\n notifyManager,\n parseMutationArgs,\n MutationObserver,\n MutationFunction,\n MutationKey,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport { shouldThrowError } from './utils'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = unknown,\n TVariables = void,\n TContext = unknown,\n>(\n options: UseMutationOptions<TData, TError, TVariables, TContext>,\n): UseMutationResult<TData, TError, TVariables, TContext>\nexport function useMutation<\n TData = unknown,\n TError = unknown,\n TVariables = void,\n TContext = unknown,\n>(\n mutationFn: MutationFunction<TData, TVariables>,\n options?: Omit<\n UseMutationOptions<TData, TError, TVariables, TContext>,\n 'mutationFn'\n >,\n): UseMutationResult<TData, TError, TVariables, TContext>\nexport function useMutation<\n TData = unknown,\n TError = unknown,\n TVariables = void,\n TContext = unknown,\n>(\n mutationKey: MutationKey,\n options?: Omit<\n UseMutationOptions<TData, TError, TVariables, TContext>,\n 'mutationKey'\n >,\n): UseMutationResult<TData, TError, TVariables, TContext>\nexport function useMutation<\n TData = unknown,\n TError = unknown,\n TVariables = void,\n TContext = unknown,\n>(\n mutationKey: MutationKey,\n mutationFn?: MutationFunction<TData, TVariables>,\n options?: Omit<\n UseMutationOptions<TData, TError, TVariables, TContext>,\n 'mutationKey' | 'mutationFn'\n >,\n): UseMutationResult<TData, TError, TVariables, TContext>\nexport function useMutation<\n TData = unknown,\n TError = unknown,\n TVariables = void,\n TContext = unknown,\n>(\n arg1:\n | MutationKey\n | MutationFunction<TData, TVariables>\n | UseMutationOptions<TData, TError, TVariables, TContext>,\n arg2?:\n | MutationFunction<TData, TVariables>\n | UseMutationOptions<TData, TError, TVariables, TContext>,\n arg3?: UseMutationOptions<TData, TError, TVariables, TContext>,\n): UseMutationResult<TData, TError, TVariables, TContext> {\n const options = parseMutationArgs(arg1, arg2, arg3)\n const queryClient = useQueryClient({ context: options.context })\n\n const [observer] = React.useState(\n () =>\n new MutationObserver<TData, TError, TVariables, TContext>(\n queryClient,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction<TData, TError, TVariables, TContext>\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.useErrorBoundary, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction noop() {}\n","import {\n QueryObserver,\n InfiniteQueryObserver,\n QueryFunction,\n QueryKey,\n parseQueryArgs,\n} from '@tanstack/query-core'\nimport { UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types'\nimport { useBaseQuery } from './useBaseQuery'\n\n// HOOK\n\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n): UseInfiniteQueryResult<TData, TError>\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n options?: Omit<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n 'queryKey'\n >,\n): UseInfiniteQueryResult<TData, TError>\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n queryFn: QueryFunction<TQueryFnData, TQueryKey>,\n options?: Omit<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n 'queryKey' | 'queryFn'\n >,\n): UseInfiniteQueryResult<TData, TError>\nexport function useInfiniteQuery<\n TQueryFnData,\n TError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n arg1:\n | TQueryKey\n | UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n arg2?:\n | QueryFunction<TQueryFnData, TQueryKey>\n | UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n arg3?: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n): UseInfiniteQueryResult<TData, TError> {\n const options = parseQueryArgs(arg1, arg2, arg3)\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n ) as UseInfiniteQueryResult<TData, TError>\n}\n"],"names":["unstable_batchedUpdates","ReactDOM","notifyManager","setBatchNotifyFunction","require$$0","require$$1","defaultContext","React","createContext","undefined","QueryClientSharingContext","getQueryClientContext","context","contextSharing","window","ReactQueryClientContext","useQueryClient","queryClient","useContext","Error","QueryClientProvider","client","children","useEffect","mount","unmount","Context","IsRestoringContext","useIsRestoring","IsRestoringProvider","Provider","useQueries","queries","isRestoring","defaultedQueries","useMemo","map","options","defaultedOptions","defaultQueryOptions","_optimisticResults","observer","useState","QueriesObserver","result","getOptimisticResult","useSyncExternalStore","useCallback","onStoreChange","subscribe","batchCalls","getCurrentResult","setQueries","listeners","createValue","isReset","clearReset","reset","QueryErrorResetBoundaryContext","useQueryErrorResetBoundary","QueryErrorResetBoundary","value","shouldThrowError","_useErrorBoundary","params","useBaseQuery","Observer","errorResetBoundary","onError","onSuccess","onSettled","suspense","staleTime","useErrorBoundary","retryOnMount","setOptions","isLoading","isFetching","fetchOptimistic","then","data","catch","error","isError","getCurrentQuery","notifyOnChangeProps","trackResult","useQuery","arg1","arg2","arg3","parsedOptions","parseQueryArgs","QueryObserver","useHydrate","state","optionsRef","useRef","current","hydrate","Hydrate","useIsFetching","filters","parseFilterArgs","queryCache","getQueryCache","useIsMutating","parseMutationFilterArgs","mutationCache","getMutationCache","isMutating","useMutation","parseMutationArgs","MutationObserver","mutate","variables","mutateOptions","noop","mutateAsync","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,MAAMO,MAAM,GAAGE,iCAAoB,CACjCvC,KAAK,CAACwC,WAAN,CACGC,aAAD,IACEP,QAAQ,CAACQ,SAAT,CAAmB/C,aAAa,CAACgD,UAAd,CAAyBF,aAAzB,CAAnB,CAFJ,EAGE,CAACP,QAAD,CAHF,CADiC,EAMjC,MAAMA,QAAQ,CAACU,gBAAT,EAN2B,EAOjC,MAAMV,QAAQ,CAACU,gBAAT,EAP2B,CAAnC,CAAA;EAUA,MAAM+D,MAAM,GAAG3G,KAAK,CAACwC,WAAN,CAGb,CAACoE,SAAD,EAAYC,aAAZ,KAA8B;IAC5B3E,QAAQ,CAACyE,MAAT,CAAgBC,SAAhB,EAA2BC,aAA3B,CAAA,CAA0CnC,KAA1C,CAAgDoC,IAAhD,CAAA,CAAA;AACD,GALY,EAMb,CAAC5E,QAAD,CANa,CAAf,CAAA;;AASA,EAAA,IACEG,MAAM,CAACsC,KAAP,IACApB,gBAAgB,CAACrB,QAAQ,CAACJ,OAAT,CAAiBoC,gBAAlB,EAAoC,CAAC7B,MAAM,CAACsC,KAAR,CAApC,CAFlB,EAGE;IACA,MAAMtC,MAAM,CAACsC,KAAb,CAAA;AACD,GAAA;;EAED,OAAO,EAAE,GAAGtC,MAAL;IAAasE,MAAb;IAAqBI,WAAW,EAAE1E,MAAM,CAACsE,MAAAA;GAAhD,CAAA;AACD;;AAGD,SAASG,IAAT,GAAgB;;AC9DT,SAASE,gBAAT,CAML/B,IANK,EAeLC,IAfK,EAwBLC,IAxBK,EA+BkC;EACvC,MAAMrD,OAAO,GAAGuD,cAAc,CAACJ,IAAD,EAAOC,IAAP,EAAaC,IAAb,CAA9B,CAAA;AACA,EAAA,OAAOzB,YAAY,CACjB5B,OADiB,EAEjBmF,qBAFiB,CAAnB,CAAA;AAID;;;;"}
@@ -0,0 +1 @@
1
+ export { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';
@@ -0,0 +1 @@
1
+ export { useSyncExternalStore } from 'use-sync-external-store/shim/index.native.js';
@@ -9,10 +9,12 @@
9
9
  * @license MIT
10
10
  */
11
11
  (function (global, factory) {
12
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('use-sync-external-store/shim')) :
13
- typeof define === 'function' && define.amd ? define(['exports', 'react', 'use-sync-external-store/shim'], factory) :
14
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactQuery = {}, global.React, global.shim));
15
- })(this, (function (exports, React, shim) { 'use strict';
12
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react-dom'), require('react')) :
13
+ typeof define === 'function' && define.amd ? define(['exports', 'react-dom', 'react'], factory) :
14
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactQuery = {}, global.ReactDOM, global.React));
15
+ })(this, (function (exports, ReactDOM, React) { 'use strict';
16
+
17
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
18
 
17
19
  function _interopNamespace(e) {
18
20
  if (e && e.__esModule) return e;
@@ -32,6 +34,8 @@
32
34
  return Object.freeze(n);
33
35
  }
34
36
 
37
+ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
38
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
35
39
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
36
40
 
37
41
  /**
@@ -377,6 +381,8 @@
377
381
  // Use prev data if an isDataEqual function is defined and returns `true`
378
382
  if (options.isDataEqual != null && options.isDataEqual(prevData, data)) {
379
383
  return prevData;
384
+ } else if (typeof options.structuralSharing === 'function') {
385
+ return options.structuralSharing(prevData, data);
380
386
  } else if (options.structuralSharing !== false) {
381
387
  // Structurally share data between prev and new data if needed
382
388
  return replaceEqualDeep(prevData, data);
@@ -3122,6 +3128,265 @@
3122
3128
  });
3123
3129
  }
3124
3130
 
3131
+ const unstable_batchedUpdates = ReactDOM__namespace.unstable_batchedUpdates;
3132
+
3133
+ notifyManager.setBatchNotifyFunction(unstable_batchedUpdates);
3134
+
3135
+ var shim = {exports: {}};
3136
+
3137
+ var useSyncExternalStoreShim_development = {};
3138
+
3139
+ /**
3140
+ * @license React
3141
+ * use-sync-external-store-shim.development.js
3142
+ *
3143
+ * Copyright (c) Facebook, Inc. and its affiliates.
3144
+ *
3145
+ * This source code is licensed under the MIT license found in the
3146
+ * LICENSE file in the root directory of this source tree.
3147
+ */
3148
+
3149
+ var hasRequiredUseSyncExternalStoreShim_development;
3150
+
3151
+ function requireUseSyncExternalStoreShim_development () {
3152
+ if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
3153
+ hasRequiredUseSyncExternalStoreShim_development = 1;
3154
+
3155
+ {
3156
+ (function() {
3157
+
3158
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
3159
+ if (
3160
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
3161
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
3162
+ 'function'
3163
+ ) {
3164
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
3165
+ }
3166
+ var React = React__default["default"];
3167
+
3168
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3169
+
3170
+ function error(format) {
3171
+ {
3172
+ {
3173
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
3174
+ args[_key2 - 1] = arguments[_key2];
3175
+ }
3176
+
3177
+ printWarning('error', format, args);
3178
+ }
3179
+ }
3180
+ }
3181
+
3182
+ function printWarning(level, format, args) {
3183
+ // When changing this logic, you might want to also
3184
+ // update consoleWithStackDev.www.js as well.
3185
+ {
3186
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
3187
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
3188
+
3189
+ if (stack !== '') {
3190
+ format += '%s';
3191
+ args = args.concat([stack]);
3192
+ } // eslint-disable-next-line react-internal/safe-string-coercion
3193
+
3194
+
3195
+ var argsWithFormat = args.map(function (item) {
3196
+ return String(item);
3197
+ }); // Careful: RN currently depends on this prefix
3198
+
3199
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
3200
+ // breaks IE9: https://github.com/facebook/react/issues/13610
3201
+ // eslint-disable-next-line react-internal/no-production-logging
3202
+
3203
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
3204
+ }
3205
+ }
3206
+
3207
+ /**
3208
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
3209
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
3210
+ */
3211
+ function is(x, y) {
3212
+ return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
3213
+ ;
3214
+ }
3215
+
3216
+ var objectIs = typeof Object.is === 'function' ? Object.is : is;
3217
+
3218
+ // dispatch for CommonJS interop named imports.
3219
+
3220
+ var useState = React.useState,
3221
+ useEffect = React.useEffect,
3222
+ useLayoutEffect = React.useLayoutEffect,
3223
+ useDebugValue = React.useDebugValue;
3224
+ var didWarnOld18Alpha = false;
3225
+ var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
3226
+ // because of a very particular set of implementation details and assumptions
3227
+ // -- change any one of them and it will break. The most important assumption
3228
+ // is that updates are always synchronous, because concurrent rendering is
3229
+ // only available in versions of React that also have a built-in
3230
+ // useSyncExternalStore API. And we only use this shim when the built-in API
3231
+ // does not exist.
3232
+ //
3233
+ // Do not assume that the clever hacks used by this hook also work in general.
3234
+ // The point of this shim is to replace the need for hacks by other libraries.
3235
+
3236
+ function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
3237
+ // React do not expose a way to check if we're hydrating. So users of the shim
3238
+ // will need to track that themselves and return the correct value
3239
+ // from `getSnapshot`.
3240
+ getServerSnapshot) {
3241
+ {
3242
+ if (!didWarnOld18Alpha) {
3243
+ if (React.startTransition !== undefined) {
3244
+ didWarnOld18Alpha = true;
3245
+
3246
+ error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
3247
+ }
3248
+ }
3249
+ } // Read the current snapshot from the store on every render. Again, this
3250
+ // breaks the rules of React, and only works here because of specific
3251
+ // implementation details, most importantly that updates are
3252
+ // always synchronous.
3253
+
3254
+
3255
+ var value = getSnapshot();
3256
+
3257
+ {
3258
+ if (!didWarnUncachedGetSnapshot) {
3259
+ var cachedValue = getSnapshot();
3260
+
3261
+ if (!objectIs(value, cachedValue)) {
3262
+ error('The result of getSnapshot should be cached to avoid an infinite loop');
3263
+
3264
+ didWarnUncachedGetSnapshot = true;
3265
+ }
3266
+ }
3267
+ } // Because updates are synchronous, we don't queue them. Instead we force a
3268
+ // re-render whenever the subscribed state changes by updating an some
3269
+ // arbitrary useState hook. Then, during render, we call getSnapshot to read
3270
+ // the current value.
3271
+ //
3272
+ // Because we don't actually use the state returned by the useState hook, we
3273
+ // can save a bit of memory by storing other stuff in that slot.
3274
+ //
3275
+ // To implement the early bailout, we need to track some things on a mutable
3276
+ // object. Usually, we would put that in a useRef hook, but we can stash it in
3277
+ // our useState hook instead.
3278
+ //
3279
+ // To force a re-render, we call forceUpdate({inst}). That works because the
3280
+ // new object always fails an equality check.
3281
+
3282
+
3283
+ var _useState = useState({
3284
+ inst: {
3285
+ value: value,
3286
+ getSnapshot: getSnapshot
3287
+ }
3288
+ }),
3289
+ inst = _useState[0].inst,
3290
+ forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
3291
+ // in the layout phase so we can access it during the tearing check that
3292
+ // happens on subscribe.
3293
+
3294
+
3295
+ useLayoutEffect(function () {
3296
+ inst.value = value;
3297
+ inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
3298
+ // commit phase if there was an interleaved mutation. In concurrent mode
3299
+ // this can happen all the time, but even in synchronous mode, an earlier
3300
+ // effect may have mutated the store.
3301
+
3302
+ if (checkIfSnapshotChanged(inst)) {
3303
+ // Force a re-render.
3304
+ forceUpdate({
3305
+ inst: inst
3306
+ });
3307
+ }
3308
+ }, [subscribe, value, getSnapshot]);
3309
+ useEffect(function () {
3310
+ // Check for changes right before subscribing. Subsequent changes will be
3311
+ // detected in the subscription handler.
3312
+ if (checkIfSnapshotChanged(inst)) {
3313
+ // Force a re-render.
3314
+ forceUpdate({
3315
+ inst: inst
3316
+ });
3317
+ }
3318
+
3319
+ var handleStoreChange = function () {
3320
+ // TODO: Because there is no cross-renderer API for batching updates, it's
3321
+ // up to the consumer of this library to wrap their subscription event
3322
+ // with unstable_batchedUpdates. Should we try to detect when this isn't
3323
+ // the case and print a warning in development?
3324
+ // The store changed. Check if the snapshot changed since the last time we
3325
+ // read from the store.
3326
+ if (checkIfSnapshotChanged(inst)) {
3327
+ // Force a re-render.
3328
+ forceUpdate({
3329
+ inst: inst
3330
+ });
3331
+ }
3332
+ }; // Subscribe to the store and return a clean-up function.
3333
+
3334
+
3335
+ return subscribe(handleStoreChange);
3336
+ }, [subscribe]);
3337
+ useDebugValue(value);
3338
+ return value;
3339
+ }
3340
+
3341
+ function checkIfSnapshotChanged(inst) {
3342
+ var latestGetSnapshot = inst.getSnapshot;
3343
+ var prevValue = inst.value;
3344
+
3345
+ try {
3346
+ var nextValue = latestGetSnapshot();
3347
+ return !objectIs(prevValue, nextValue);
3348
+ } catch (error) {
3349
+ return true;
3350
+ }
3351
+ }
3352
+
3353
+ function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
3354
+ // Note: The shim does not use getServerSnapshot, because pre-18 versions of
3355
+ // React do not expose a way to check if we're hydrating. So users of the shim
3356
+ // will need to track that themselves and return the correct value
3357
+ // from `getSnapshot`.
3358
+ return getSnapshot();
3359
+ }
3360
+
3361
+ var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
3362
+
3363
+ var isServerEnvironment = !canUseDOM;
3364
+
3365
+ var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
3366
+ var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
3367
+
3368
+ useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
3369
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
3370
+ if (
3371
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
3372
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
3373
+ 'function'
3374
+ ) {
3375
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
3376
+ }
3377
+
3378
+ })();
3379
+ }
3380
+ return useSyncExternalStoreShim_development;
3381
+ }
3382
+
3383
+ (function (module) {
3384
+
3385
+ {
3386
+ module.exports = requireUseSyncExternalStoreShim_development();
3387
+ }
3388
+ } (shim));
3389
+
3125
3390
  const defaultContext = /*#__PURE__*/React__namespace.createContext(undefined);
3126
3391
  const QueryClientSharingContext = /*#__PURE__*/React__namespace.createContext(false); // If we are given a context, we will use it.
3127
3392
  // Otherwise, if contextSharing is on, we share the first and at least one
@@ -3200,7 +3465,7 @@
3200
3465
  }), [queries, queryClient, isRestoring]);
3201
3466
  const [observer] = React__namespace.useState(() => new QueriesObserver(queryClient, defaultedQueries));
3202
3467
  const result = observer.getOptimisticResult(defaultedQueries);
3203
- shim.useSyncExternalStore(React__namespace.useCallback(onStoreChange => isRestoring ? () => undefined : observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer, isRestoring]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
3468
+ shim.exports.useSyncExternalStore(React__namespace.useCallback(onStoreChange => isRestoring ? () => undefined : observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer, isRestoring]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
3204
3469
  React__namespace.useEffect(() => {
3205
3470
  // Do not notify on updates because of changes in the options because
3206
3471
  // these changes should already be reflected in the optimistic result.
@@ -3287,7 +3552,7 @@
3287
3552
 
3288
3553
  const [observer] = React__namespace.useState(() => new Observer(queryClient, defaultedOptions));
3289
3554
  const result = observer.getOptimisticResult(defaultedOptions);
3290
- shim.useSyncExternalStore(React__namespace.useCallback(onStoreChange => isRestoring ? () => undefined : observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer, isRestoring]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
3555
+ shim.exports.useSyncExternalStore(React__namespace.useCallback(onStoreChange => isRestoring ? () => undefined : observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer, isRestoring]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
3291
3556
  React__namespace.useEffect(() => {
3292
3557
  errorResetBoundary.clearReset();
3293
3558
  }, [errorResetBoundary]);
@@ -3357,7 +3622,7 @@
3357
3622
  context: options.context
3358
3623
  });
3359
3624
  const queryCache = queryClient.getQueryCache();
3360
- return shim.useSyncExternalStore(React__namespace.useCallback(onStoreChange => queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), [queryCache]), () => queryClient.isFetching(filters), () => queryClient.isFetching(filters));
3625
+ return shim.exports.useSyncExternalStore(React__namespace.useCallback(onStoreChange => queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), [queryCache]), () => queryClient.isFetching(filters), () => queryClient.isFetching(filters));
3361
3626
  }
3362
3627
 
3363
3628
  function useIsMutating(arg1, arg2, arg3) {
@@ -3366,7 +3631,7 @@
3366
3631
  context: options.context
3367
3632
  });
3368
3633
  const mutationCache = queryClient.getMutationCache();
3369
- return shim.useSyncExternalStore(React__namespace.useCallback(onStoreChange => mutationCache.subscribe(notifyManager.batchCalls(onStoreChange)), [mutationCache]), () => queryClient.isMutating(filters), () => queryClient.isMutating(filters));
3634
+ return shim.exports.useSyncExternalStore(React__namespace.useCallback(onStoreChange => mutationCache.subscribe(notifyManager.batchCalls(onStoreChange)), [mutationCache]), () => queryClient.isMutating(filters), () => queryClient.isMutating(filters));
3370
3635
  }
3371
3636
 
3372
3637
  function useMutation(arg1, arg2, arg3) {
@@ -3378,7 +3643,7 @@
3378
3643
  React__namespace.useEffect(() => {
3379
3644
  observer.setOptions(options);
3380
3645
  }, [observer, options]);
3381
- const result = shim.useSyncExternalStore(React__namespace.useCallback(onStoreChange => observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
3646
+ const result = shim.exports.useSyncExternalStore(React__namespace.useCallback(onStoreChange => observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
3382
3647
  const mutate = React__namespace.useCallback((variables, mutateOptions) => {
3383
3648
  observer.mutate(variables, mutateOptions).catch(noop);
3384
3649
  }, [observer]);