@tanstack/react-query 5.0.0-alpha.2 → 5.0.0-alpha.23

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 (111) hide show
  1. package/build/lib/HydrationBoundary.esm.js +1 -0
  2. package/build/lib/HydrationBoundary.esm.js.map +1 -1
  3. package/build/lib/HydrationBoundary.js +1 -0
  4. package/build/lib/HydrationBoundary.js.map +1 -1
  5. package/build/lib/HydrationBoundary.mjs +1 -0
  6. package/build/lib/HydrationBoundary.mjs.map +1 -1
  7. package/build/lib/QueryClientProvider.esm.js +1 -0
  8. package/build/lib/QueryClientProvider.esm.js.map +1 -1
  9. package/build/lib/QueryClientProvider.js +1 -0
  10. package/build/lib/QueryClientProvider.js.map +1 -1
  11. package/build/lib/QueryClientProvider.mjs +1 -0
  12. package/build/lib/QueryClientProvider.mjs.map +1 -1
  13. package/build/lib/QueryErrorResetBoundary.esm.js +1 -0
  14. package/build/lib/QueryErrorResetBoundary.esm.js.map +1 -1
  15. package/build/lib/QueryErrorResetBoundary.js +1 -0
  16. package/build/lib/QueryErrorResetBoundary.js.map +1 -1
  17. package/build/lib/QueryErrorResetBoundary.mjs +1 -0
  18. package/build/lib/QueryErrorResetBoundary.mjs.map +1 -1
  19. package/build/lib/__tests__/ssr.test.d.ts +0 -3
  20. package/build/lib/__tests__/utils.d.ts +2 -3
  21. package/build/lib/errorBoundaryUtils.d.ts +3 -3
  22. package/build/lib/errorBoundaryUtils.esm.js +4 -3
  23. package/build/lib/errorBoundaryUtils.esm.js.map +1 -1
  24. package/build/lib/errorBoundaryUtils.js +4 -3
  25. package/build/lib/errorBoundaryUtils.js.map +1 -1
  26. package/build/lib/errorBoundaryUtils.mjs +4 -3
  27. package/build/lib/errorBoundaryUtils.mjs.map +1 -1
  28. package/build/lib/isRestoring.esm.js +1 -0
  29. package/build/lib/isRestoring.esm.js.map +1 -1
  30. package/build/lib/isRestoring.js +1 -0
  31. package/build/lib/isRestoring.js.map +1 -1
  32. package/build/lib/isRestoring.mjs +1 -0
  33. package/build/lib/isRestoring.mjs.map +1 -1
  34. package/build/lib/suspense.d.ts +1 -1
  35. package/build/lib/suspense.esm.js +2 -9
  36. package/build/lib/suspense.esm.js.map +1 -1
  37. package/build/lib/suspense.js +2 -9
  38. package/build/lib/suspense.js.map +1 -1
  39. package/build/lib/suspense.mjs +1 -8
  40. package/build/lib/suspense.mjs.map +1 -1
  41. package/build/lib/useBaseQuery.esm.js +2 -12
  42. package/build/lib/useBaseQuery.esm.js.map +1 -1
  43. package/build/lib/useBaseQuery.js +2 -12
  44. package/build/lib/useBaseQuery.js.map +1 -1
  45. package/build/lib/useBaseQuery.mjs +2 -12
  46. package/build/lib/useBaseQuery.mjs.map +1 -1
  47. package/build/lib/useInfiniteQuery.esm.js +1 -0
  48. package/build/lib/useInfiniteQuery.esm.js.map +1 -1
  49. package/build/lib/useInfiniteQuery.js +1 -0
  50. package/build/lib/useInfiniteQuery.js.map +1 -1
  51. package/build/lib/useInfiniteQuery.mjs +1 -0
  52. package/build/lib/useInfiniteQuery.mjs.map +1 -1
  53. package/build/lib/useIsFetching.esm.js +1 -0
  54. package/build/lib/useIsFetching.esm.js.map +1 -1
  55. package/build/lib/useIsFetching.js +1 -0
  56. package/build/lib/useIsFetching.js.map +1 -1
  57. package/build/lib/useIsFetching.mjs +1 -0
  58. package/build/lib/useIsFetching.mjs.map +1 -1
  59. package/build/lib/useMutation.esm.js +2 -1
  60. package/build/lib/useMutation.esm.js.map +1 -1
  61. package/build/lib/useMutation.js +2 -1
  62. package/build/lib/useMutation.js.map +1 -1
  63. package/build/lib/useMutation.mjs +2 -1
  64. package/build/lib/useMutation.mjs.map +1 -1
  65. package/build/lib/useMutationState.d.ts +3 -3
  66. package/build/lib/useMutationState.esm.js +1 -0
  67. package/build/lib/useMutationState.esm.js.map +1 -1
  68. package/build/lib/useMutationState.js +1 -0
  69. package/build/lib/useMutationState.js.map +1 -1
  70. package/build/lib/useMutationState.mjs +1 -0
  71. package/build/lib/useMutationState.mjs.map +1 -1
  72. package/build/lib/useQueries.d.ts +2 -3
  73. package/build/lib/useQueries.esm.js +20 -16
  74. package/build/lib/useQueries.esm.js.map +1 -1
  75. package/build/lib/useQueries.js +20 -16
  76. package/build/lib/useQueries.js.map +1 -1
  77. package/build/lib/useQueries.mjs +12 -11
  78. package/build/lib/useQueries.mjs.map +1 -1
  79. package/build/lib/useQuery.esm.js +1 -0
  80. package/build/lib/useQuery.esm.js.map +1 -1
  81. package/build/lib/useQuery.js +1 -0
  82. package/build/lib/useQuery.js.map +1 -1
  83. package/build/lib/useQuery.mjs +1 -0
  84. package/build/lib/useQuery.mjs.map +1 -1
  85. package/build/umd/index.development.js +118 -148
  86. package/build/umd/index.development.js.map +1 -1
  87. package/build/umd/index.production.js +1 -1
  88. package/build/umd/index.production.js.map +1 -1
  89. package/package.json +3 -3
  90. package/src/__tests__/HydrationBoundary.test.tsx +4 -3
  91. package/src/__tests__/QueryClientProvider.test.tsx +2 -1
  92. package/src/__tests__/QueryResetErrorBoundary.test.tsx +753 -620
  93. package/src/__tests__/ssr-hydration.test.tsx +11 -10
  94. package/src/__tests__/ssr.test.tsx +4 -7
  95. package/src/__tests__/suspense.test.tsx +17 -98
  96. package/src/__tests__/useInfiniteQuery.test.tsx +18 -16
  97. package/src/__tests__/useInfiniteQuery.type.test.tsx +94 -13
  98. package/src/__tests__/useMutation.test.tsx +25 -24
  99. package/src/__tests__/useMutationState.test.tsx +24 -58
  100. package/src/__tests__/useQueries.test.tsx +34 -163
  101. package/src/__tests__/useQuery.test.tsx +180 -365
  102. package/src/__tests__/utils.tsx +3 -2
  103. package/src/errorBoundaryUtils.ts +6 -5
  104. package/src/suspense.ts +3 -11
  105. package/src/useBaseQuery.ts +2 -20
  106. package/src/useInfiniteQuery.ts +1 -0
  107. package/src/useIsFetching.ts +1 -0
  108. package/src/useMutation.ts +2 -1
  109. package/src/useMutationState.ts +4 -3
  110. package/src/useQueries.ts +20 -19
  111. package/src/useQuery.ts +1 -0
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
  import { hydrate } from '@tanstack/query-core';
3
4
  import { useQueryClient } from './QueryClientProvider.esm.js';
@@ -1 +1 @@
1
- {"version":3,"file":"HydrationBoundary.esm.js","sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\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(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"names":["HydrationBoundary","children","options","state","queryClient","client","useQueryClient","optionsRef","React","useRef","current","useMemo","hydrate"],"mappings":";;;;AAcO,MAAMA,iBAAiB,GAAG,CAAC;EAChCC,QAAQ;EACRC,OAAO,GAAG,EAAE;EACZC,KAAK;AACLC,EAAAA,WAAAA;AACsB,CAAC,KAAK;AAC5B,EAAA,MAAMC,MAAM,GAAGC,cAAc,CAACF,WAAW,CAAC,CAAA;AAE1C,EAAA,MAAMG,UAAU,GAAGC,KAAK,CAACC,MAAM,CAACP,OAAO,CAAC,CAAA;EACxCK,UAAU,CAACG,OAAO,GAAGR,OAAO,CAAA;;AAE5B;AACA;AACA;AACA;EACAM,KAAK,CAACG,OAAO,CAAC,MAAM;AAClB,IAAA,IAAIR,KAAK,EAAE;MACTS,OAAO,CAACP,MAAM,EAAEF,KAAK,EAAEI,UAAU,CAACG,OAAO,CAAC,CAAA;AAC5C,KAAA;AACF,GAAC,EAAE,CAACL,MAAM,EAAEF,KAAK,CAAC,CAAC,CAAA;AAEnB,EAAA,OAAOF,QAAQ,CAAA;AACjB;;;;"}
1
+ {"version":3,"file":"HydrationBoundary.esm.js","sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\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(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"names":["queryClient"],"mappings":";;;;;AAcO;;;;AAILA;AACsB;AACtB;AAEA;;;AAGA;AACA;AACA;AACA;;AAEE;;AAEA;AACF;AAEA;AACF;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  var React = require('react');
@@ -1 +1 @@
1
- {"version":3,"file":"HydrationBoundary.js","sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\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(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"names":["HydrationBoundary","children","options","state","queryClient","client","useQueryClient","optionsRef","React","useRef","current","useMemo","hydrate"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAMA,iBAAiB,GAAG,CAAC;EAChCC,QAAQ;EACRC,OAAO,GAAG,EAAE;EACZC,KAAK;AACLC,EAAAA,WAAAA;AACsB,CAAC,KAAK;AAC5B,EAAA,MAAMC,MAAM,GAAGC,kCAAc,CAACF,WAAW,CAAC,CAAA;AAE1C,EAAA,MAAMG,UAAU,GAAGC,gBAAK,CAACC,MAAM,CAACP,OAAO,CAAC,CAAA;EACxCK,UAAU,CAACG,OAAO,GAAGR,OAAO,CAAA;;AAE5B;AACA;AACA;AACA;EACAM,gBAAK,CAACG,OAAO,CAAC,MAAM;AAClB,IAAA,IAAIR,KAAK,EAAE;MACTS,iBAAO,CAACP,MAAM,EAAEF,KAAK,EAAEI,UAAU,CAACG,OAAO,CAAC,CAAA;AAC5C,KAAA;AACF,GAAC,EAAE,CAACL,MAAM,EAAEF,KAAK,CAAC,CAAC,CAAA;AAEnB,EAAA,OAAOF,QAAQ,CAAA;AACjB;;;;"}
1
+ {"version":3,"file":"HydrationBoundary.js","sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\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(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"names":["queryClient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAcO;;;;AAILA;AACsB;AACtB;AAEA;;;AAGA;AACA;AACA;AACA;;AAEE;;AAEA;AACF;AAEA;AACF;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
  import { hydrate } from '@tanstack/query-core';
3
4
  import { useQueryClient } from './QueryClientProvider.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"HydrationBoundary.mjs","sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\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(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"names":["HydrationBoundary","children","options","state","queryClient","client","useQueryClient","optionsRef","React","useRef","current","useMemo","hydrate"],"mappings":";;;;AAcO,MAAMA,iBAAiB,GAAG,CAAC;EAChCC,QAAQ;EACRC,OAAO,GAAG,EAAE;EACZC,KAAK;AACLC,EAAAA,WAAAA;AACsB,CAAC,KAAK;AAC5B,EAAA,MAAMC,MAAM,GAAGC,cAAc,CAACF,WAAW,CAAC,CAAA;AAE1C,EAAA,MAAMG,UAAU,GAAGC,KAAK,CAACC,MAAM,CAACP,OAAO,CAAC,CAAA;EACxCK,UAAU,CAACG,OAAO,GAAGR,OAAO,CAAA;;AAE5B;AACA;AACA;AACA;EACAM,KAAK,CAACG,OAAO,CAAC,MAAM;AAClB,IAAA,IAAIR,KAAK,EAAE;MACTS,OAAO,CAACP,MAAM,EAAEF,KAAK,EAAEI,UAAU,CAACG,OAAO,CAAC,CAAA;AAC5C,KAAA;AACF,GAAC,EAAE,CAACL,MAAM,EAAEF,KAAK,CAAC,CAAC,CAAA;AAEnB,EAAA,OAAOF,QAAQ,CAAA;AACjB;;;;"}
1
+ {"version":3,"file":"HydrationBoundary.mjs","sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\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(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"names":["queryClient"],"mappings":";;;;;AAcO;;;;AAILA;AACsB;AACtB;AAEA;;;AAGA;AACA;AACA;AACA;;AAEE;;AAEA;AACF;AAEA;AACF;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
 
3
4
  const QueryClientContext = /*#__PURE__*/React.createContext(undefined);
@@ -1 +1 @@
1
- {"version":3,"file":"QueryClientProvider.esm.js","sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n <QueryClientContext.Provider value={client}>\n {children}\n </QueryClientContext.Provider>\n )\n}\n"],"names":["QueryClientContext","React","createContext","undefined","useQueryClient","queryClient","client","useContext","Error","QueryClientProvider","children","useEffect","mount","unmount"],"mappings":";;AAKO,MAAMA,kBAAkB,gBAAGC,KAAK,CAACC,aAAa,CACnDC,SAAS,EACV;AAEYC,MAAAA,cAAc,GAAIC,WAAyB,IAAK;AAC3D,EAAA,MAAMC,MAAM,GAAGL,KAAK,CAACM,UAAU,CAACP,kBAAkB,CAAC,CAAA;AAEnD,EAAA,IAAIK,WAAW,EAAE;AACf,IAAA,OAAOA,WAAW,CAAA;AACpB,GAAA;EAEA,IAAI,CAACC,MAAM,EAAE;AACX,IAAA,MAAM,IAAIE,KAAK,CAAC,wDAAwD,CAAC,CAAA;AAC3E,GAAA;AAEA,EAAA,OAAOF,MAAM,CAAA;AACf,EAAC;AAOM,MAAMG,mBAAmB,GAAG,CAAC;EAClCH,MAAM;AACNI,EAAAA,QAAAA;AACwB,CAAC,KAAkB;EAC3CT,KAAK,CAACU,SAAS,CAAC,MAAM;IACpBL,MAAM,CAACM,KAAK,EAAE,CAAA;AACd,IAAA,OAAO,MAAM;MACXN,MAAM,CAACO,OAAO,EAAE,CAAA;KACjB,CAAA;AACH,GAAC,EAAE,CAACP,MAAM,CAAC,CAAC,CAAA;EAEZ,oBACE,KAAA,CAAA,aAAA,CAAC,kBAAkB,CAAC,QAAQ,EAAA;AAAC,IAAA,KAAK,EAAEA,MAAAA;AAAO,GAAA,EACxCI,QAAQ,CACmB,CAAA;AAElC;;;;"}
1
+ {"version":3,"file":"QueryClientProvider.esm.js","sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n <QueryClientContext.Provider value={client}>\n {children}\n </QueryClientContext.Provider>\n )\n}\n"],"names":["useQueryClient","children"],"mappings":";;;AAKO;AAIMA;AACX;AAEA;AACE;AACF;;AAGE;AACF;AAEA;AACF;AAOO;;AAELC;AACwB;;;AAGtB;;;AAGF;;AAG+B;AAAc;AAI/C;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  var React = require('react');
@@ -1 +1 @@
1
- {"version":3,"file":"QueryClientProvider.js","sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n <QueryClientContext.Provider value={client}>\n {children}\n </QueryClientContext.Provider>\n )\n}\n"],"names":["QueryClientContext","React","createContext","undefined","useQueryClient","queryClient","client","useContext","Error","QueryClientProvider","children","useEffect","mount","unmount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAMA,kBAAkB,gBAAGC,gBAAK,CAACC,aAAa,CACnDC,SAAS,EACV;AAEYC,MAAAA,cAAc,GAAIC,WAAyB,IAAK;AAC3D,EAAA,MAAMC,MAAM,GAAGL,gBAAK,CAACM,UAAU,CAACP,kBAAkB,CAAC,CAAA;AAEnD,EAAA,IAAIK,WAAW,EAAE;AACf,IAAA,OAAOA,WAAW,CAAA;AACpB,GAAA;EAEA,IAAI,CAACC,MAAM,EAAE;AACX,IAAA,MAAM,IAAIE,KAAK,CAAC,wDAAwD,CAAC,CAAA;AAC3E,GAAA;AAEA,EAAA,OAAOF,MAAM,CAAA;AACf,EAAC;AAOM,MAAMG,mBAAmB,GAAG,CAAC;EAClCH,MAAM;AACNI,EAAAA,QAAAA;AACwB,CAAC,KAAkB;EAC3CT,gBAAK,CAACU,SAAS,CAAC,MAAM;IACpBL,MAAM,CAACM,KAAK,EAAE,CAAA;AACd,IAAA,OAAO,MAAM;MACXN,MAAM,CAACO,OAAO,EAAE,CAAA;KACjB,CAAA;AACH,GAAC,EAAE,CAACP,MAAM,CAAC,CAAC,CAAA;EAEZ,oBACEL,gBAAA,CAAA,aAAA,CAAC,kBAAkB,CAAC,QAAQ,EAAA;AAAC,IAAA,KAAK,EAAEK,MAAAA;AAAO,GAAA,EACxCI,QAAQ,CACmB,CAAA;AAElC;;;;;;"}
1
+ {"version":3,"file":"QueryClientProvider.js","sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n <QueryClientContext.Provider value={client}>\n {children}\n </QueryClientContext.Provider>\n )\n}\n"],"names":["useQueryClient","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKO;AAIMA;AACX;AAEA;AACE;AACF;;AAGE;AACF;AAEA;AACF;AAOO;;AAELC;AACwB;;;AAGtB;;;AAGF;;AAG+B;AAAc;AAI/C;;;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
 
3
4
  const QueryClientContext = /*#__PURE__*/React.createContext(undefined);
@@ -1 +1 @@
1
- {"version":3,"file":"QueryClientProvider.mjs","sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n <QueryClientContext.Provider value={client}>\n {children}\n </QueryClientContext.Provider>\n )\n}\n"],"names":["QueryClientContext","React","createContext","undefined","useQueryClient","queryClient","client","useContext","Error","QueryClientProvider","children","useEffect","mount","unmount"],"mappings":";;AAKO,MAAMA,kBAAkB,gBAAGC,KAAK,CAACC,aAAa,CACnDC,SAAS,EACV;AAEYC,MAAAA,cAAc,GAAIC,WAAyB,IAAK;AAC3D,EAAA,MAAMC,MAAM,GAAGL,KAAK,CAACM,UAAU,CAACP,kBAAkB,CAAC,CAAA;AAEnD,EAAA,IAAIK,WAAW,EAAE;AACf,IAAA,OAAOA,WAAW,CAAA;AACpB,GAAA;EAEA,IAAI,CAACC,MAAM,EAAE;AACX,IAAA,MAAM,IAAIE,KAAK,CAAC,wDAAwD,CAAC,CAAA;AAC3E,GAAA;AAEA,EAAA,OAAOF,MAAM,CAAA;AACf,EAAC;AAOM,MAAMG,mBAAmB,GAAG,CAAC;EAClCH,MAAM;AACNI,EAAAA,QAAAA;AACwB,CAAC,KAAkB;EAC3CT,KAAK,CAACU,SAAS,CAAC,MAAM;IACpBL,MAAM,CAACM,KAAK,EAAE,CAAA;AACd,IAAA,OAAO,MAAM;MACXN,MAAM,CAACO,OAAO,EAAE,CAAA;KACjB,CAAA;AACH,GAAC,EAAE,CAACP,MAAM,CAAC,CAAC,CAAA;EAEZ,oBACE,KAAA,CAAA,aAAA,CAAC,kBAAkB,CAAC,QAAQ,EAAA;AAAC,IAAA,KAAK,EAAEA,MAAAA;AAAO,GAAA,EACxCI,QAAQ,CACmB,CAAA;AAElC;;;;"}
1
+ {"version":3,"file":"QueryClientProvider.mjs","sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n <QueryClientContext.Provider value={client}>\n {children}\n </QueryClientContext.Provider>\n )\n}\n"],"names":["useQueryClient","children"],"mappings":";;;AAKO;AAIMA;AACX;AAEA;AACE;AACF;;AAGE;AACF;AAEA;AACF;AAOO;;AAELC;AACwB;;;AAGtB;;;AAGF;;AAG+B;AAAc;AAI/C;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
 
3
4
  // CONTEXT
@@ -1 +1 @@
1
- {"version":3,"file":"QueryErrorResetBoundary.esm.js","sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\n\nexport interface 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"],"names":["createValue","isReset","clearReset","reset","QueryErrorResetBoundaryContext","React","createContext","useQueryErrorResetBoundary","useContext","QueryErrorResetBoundary","children","value","useState"],"mappings":";;AAGA;;AAQA,SAASA,WAAW,GAAiC;EACnD,IAAIC,OAAO,GAAG,KAAK,CAAA;EACnB,OAAO;AACLC,IAAAA,UAAU,EAAE,MAAM;AAChBD,MAAAA,OAAO,GAAG,KAAK,CAAA;KAChB;AACDE,IAAAA,KAAK,EAAE,MAAM;AACXF,MAAAA,OAAO,GAAG,IAAI,CAAA;KACf;AACDA,IAAAA,OAAO,EAAE,MAAM;AACb,MAAA,OAAOA,OAAO,CAAA;AAChB,KAAA;GACD,CAAA;AACH,CAAA;AAEA,MAAMG,8BAA8B,gBAAGC,KAAK,CAACC,aAAa,CAACN,WAAW,EAAE,CAAC,CAAA;;AAEzE;;AAEO,MAAMO,0BAA0B,GAAG,MACxCF,KAAK,CAACG,UAAU,CAACJ,8BAA8B,EAAC;;AAElD;;AAQO,MAAMK,uBAAuB,GAAG,CAAC;AACtCC,EAAAA,QAAAA;AAC4B,CAAC,KAAK;EAClC,MAAM,CAACC,KAAK,CAAC,GAAGN,KAAK,CAACO,QAAQ,CAAC,MAAMZ,WAAW,EAAE,CAAC,CAAA;EACnD,oBACE,KAAA,CAAA,aAAA,CAAC,8BAA8B,CAAC,QAAQ,EAAA;AAAC,IAAA,KAAK,EAAEW,KAAAA;GAC7C,EAAA,OAAOD,QAAQ,KAAK,UAAU,GAC1BA,QAAQ,CAAcC,KAAK,CAAC,GAC7BD,QAAQ,CAC4B,CAAA;AAE9C;;;;"}
1
+ {"version":3,"file":"QueryErrorResetBoundary.esm.js","sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\n\nexport interface 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"],"names":["clearReset","isReset","reset","children"],"mappings":";;;AAGA;;AAQA;;;AAGIA;AACEC;;AAEFC;AACED;;AAEFA;AACE;AACF;;AAEJ;AAEA;;AAEA;;AAEO;;AAGP;;AAQO;AACLE;AAC4B;;;AAGe;;AAM7C;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  var React = require('react');
@@ -1 +1 @@
1
- {"version":3,"file":"QueryErrorResetBoundary.js","sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\n\nexport interface 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"],"names":["createValue","isReset","clearReset","reset","QueryErrorResetBoundaryContext","React","createContext","useQueryErrorResetBoundary","useContext","QueryErrorResetBoundary","children","value","useState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAQA,SAASA,WAAW,GAAiC;EACnD,IAAIC,OAAO,GAAG,KAAK,CAAA;EACnB,OAAO;AACLC,IAAAA,UAAU,EAAE,MAAM;AAChBD,MAAAA,OAAO,GAAG,KAAK,CAAA;KAChB;AACDE,IAAAA,KAAK,EAAE,MAAM;AACXF,MAAAA,OAAO,GAAG,IAAI,CAAA;KACf;AACDA,IAAAA,OAAO,EAAE,MAAM;AACb,MAAA,OAAOA,OAAO,CAAA;AAChB,KAAA;GACD,CAAA;AACH,CAAA;AAEA,MAAMG,8BAA8B,gBAAGC,gBAAK,CAACC,aAAa,CAACN,WAAW,EAAE,CAAC,CAAA;;AAEzE;;AAEO,MAAMO,0BAA0B,GAAG,MACxCF,gBAAK,CAACG,UAAU,CAACJ,8BAA8B,EAAC;;AAElD;;AAQO,MAAMK,uBAAuB,GAAG,CAAC;AACtCC,EAAAA,QAAAA;AAC4B,CAAC,KAAK;EAClC,MAAM,CAACC,KAAK,CAAC,GAAGN,gBAAK,CAACO,QAAQ,CAAC,MAAMZ,WAAW,EAAE,CAAC,CAAA;EACnD,oBACEK,gBAAA,CAAA,aAAA,CAAC,8BAA8B,CAAC,QAAQ,EAAA;AAAC,IAAA,KAAK,EAAEM,KAAAA;GAC7C,EAAA,OAAOD,QAAQ,KAAK,UAAU,GAC1BA,QAAQ,CAAcC,KAAK,CAAC,GAC7BD,QAAQ,CAC4B,CAAA;AAE9C;;;;;"}
1
+ {"version":3,"file":"QueryErrorResetBoundary.js","sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\n\nexport interface 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"],"names":["clearReset","isReset","reset","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAQA;;;AAGIA;AACEC;;AAEFC;AACED;;AAEFA;AACE;AACF;;AAEJ;AAEA;;AAEA;;AAEO;;AAGP;;AAQO;AACLE;AAC4B;;;AAGe;;AAM7C;;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
 
3
4
  // CONTEXT
@@ -1 +1 @@
1
- {"version":3,"file":"QueryErrorResetBoundary.mjs","sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\n\nexport interface 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"],"names":["createValue","isReset","clearReset","reset","QueryErrorResetBoundaryContext","React","createContext","useQueryErrorResetBoundary","useContext","QueryErrorResetBoundary","children","value","useState"],"mappings":";;AAGA;;AAQA,SAASA,WAAW,GAAiC;EACnD,IAAIC,OAAO,GAAG,KAAK,CAAA;EACnB,OAAO;AACLC,IAAAA,UAAU,EAAE,MAAM;AAChBD,MAAAA,OAAO,GAAG,KAAK,CAAA;KAChB;AACDE,IAAAA,KAAK,EAAE,MAAM;AACXF,MAAAA,OAAO,GAAG,IAAI,CAAA;KACf;AACDA,IAAAA,OAAO,EAAE,MAAM;AACb,MAAA,OAAOA,OAAO,CAAA;AAChB,KAAA;GACD,CAAA;AACH,CAAA;AAEA,MAAMG,8BAA8B,gBAAGC,KAAK,CAACC,aAAa,CAACN,WAAW,EAAE,CAAC,CAAA;;AAEzE;;AAEO,MAAMO,0BAA0B,GAAG,MACxCF,KAAK,CAACG,UAAU,CAACJ,8BAA8B,EAAC;;AAElD;;AAQO,MAAMK,uBAAuB,GAAG,CAAC;AACtCC,EAAAA,QAAAA;AAC4B,CAAC,KAAK;EAClC,MAAM,CAACC,KAAK,CAAC,GAAGN,KAAK,CAACO,QAAQ,CAAC,MAAMZ,WAAW,EAAE,CAAC,CAAA;EACnD,oBACE,KAAA,CAAA,aAAA,CAAC,8BAA8B,CAAC,QAAQ,EAAA;AAAC,IAAA,KAAK,EAAEW,KAAAA;GAC7C,EAAA,OAAOD,QAAQ,KAAK,UAAU,GAC1BA,QAAQ,CAAcC,KAAK,CAAC,GAC7BD,QAAQ,CAC4B,CAAA;AAE9C;;;;"}
1
+ {"version":3,"file":"QueryErrorResetBoundary.mjs","sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\n\nexport interface 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"],"names":["clearReset","isReset","reset","children"],"mappings":";;;AAGA;;AAQA;;;AAGIA;AACEC;;AAEFC;AACED;;AAEFA;AACE;AACF;;AAEJ;AAEA;;AAEA;;AAEO;;AAGP;;AAQO;AACLE;AAC4B;;;AAGe;;AAM7C;;"}
@@ -1,4 +1 @@
1
- /**
2
- * @jest-environment node
3
- */
4
1
  export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="jest" />
2
1
  /// <reference types="node" />
3
2
  import * as React from 'react';
4
3
  import { render } from '@testing-library/react';
@@ -10,8 +9,8 @@ export declare const Blink: ({ duration, children, }: {
10
9
  children: React.ReactNode;
11
10
  }) => JSX.Element;
12
11
  export declare function createQueryClient(config?: QueryClientConfig): QueryClient;
13
- export declare function mockVisibilityState(value: DocumentVisibilityState): jest.SpyInstance<DocumentVisibilityState, [], any>;
14
- export declare function mockNavigatorOnLine(value: boolean): jest.SpyInstance<boolean, [], any>;
12
+ export declare function mockVisibilityState(value: DocumentVisibilityState): import("vitest/dist/index-1cfc7f58").S<[], DocumentVisibilityState>;
13
+ export declare function mockNavigatorOnLine(value: boolean): import("vitest/dist/index-1cfc7f58").S<[], boolean>;
15
14
  export declare function queryKey(): Array<string>;
16
15
  export declare function sleep(timeout: number): Promise<void>;
17
16
  export declare function setActTimeout(fn: () => void, ms?: number): NodeJS.Timeout;
@@ -1,10 +1,10 @@
1
- import type { DefaultedQueryObserverOptions, Query, QueryKey, QueryObserverResult, ThrowErrors } from '@tanstack/query-core';
1
+ import type { DefaultedQueryObserverOptions, Query, QueryKey, QueryObserverResult, ThrowOnError } from '@tanstack/query-core';
2
2
  import type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary';
3
3
  export declare const ensurePreventErrorBoundaryRetry: <TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(options: DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, errorResetBoundary: QueryErrorResetBoundaryValue) => void;
4
4
  export declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void;
5
- export declare const getHasError: <TData, TError, TQueryFnData, TQueryData, TQueryKey extends QueryKey>({ result, errorResetBoundary, throwErrors, query, }: {
5
+ export declare const getHasError: <TData, TError, TQueryFnData, TQueryData, TQueryKey extends QueryKey>({ result, errorResetBoundary, throwOnError, query, }: {
6
6
  result: QueryObserverResult<TData, TError>;
7
7
  errorResetBoundary: QueryErrorResetBoundaryValue;
8
- throwErrors: ThrowErrors<TQueryFnData, TError, TQueryData, TQueryKey>;
8
+ throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>;
9
9
  query: Query<TQueryFnData, TError, TQueryData, TQueryKey>;
10
10
  }) => boolean;
@@ -1,8 +1,9 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
  import { shouldThrowError } from './utils.esm.js';
3
4
 
4
5
  const ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
5
- if (options.suspense || options.throwErrors) {
6
+ if (options.suspense || options.throwOnError) {
6
7
  // Prevent retrying failed query if the error boundary has not been reset yet
7
8
  if (!errorResetBoundary.isReset()) {
8
9
  options.retryOnMount = false;
@@ -17,10 +18,10 @@ const useClearResetErrorBoundary = errorResetBoundary => {
17
18
  const getHasError = ({
18
19
  result,
19
20
  errorResetBoundary,
20
- throwErrors,
21
+ throwOnError,
21
22
  query
22
23
  }) => {
23
- return result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(throwErrors, [result.error, query]);
24
+ return result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(throwOnError, [result.error, query]);
24
25
  };
25
26
 
26
27
  export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary };
@@ -1 +1 @@
1
- {"version":3,"file":"errorBoundaryUtils.esm.js","sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["import type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowErrors,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\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.throwErrors) {\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 throwErrors,\n query,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwErrors: ThrowErrors<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n shouldThrowError(throwErrors, [result.error, query])\n )\n}\n"],"names":["ensurePreventErrorBoundaryRetry","options","errorResetBoundary","suspense","throwErrors","isReset","retryOnMount","useClearResetErrorBoundary","React","useEffect","clearReset","getHasError","result","query","isError","isFetching","shouldThrowError","error"],"mappings":";;;MAWaA,+BAA+B,GAAG,CAO7CC,OAMC,EACDC,kBAAgD,KAC7C;AACH,EAAA,IAAID,OAAO,CAACE,QAAQ,IAAIF,OAAO,CAACG,WAAW,EAAE;AAC3C;AACA,IAAA,IAAI,CAACF,kBAAkB,CAACG,OAAO,EAAE,EAAE;MACjCJ,OAAO,CAACK,YAAY,GAAG,KAAK,CAAA;AAC9B,KAAA;AACF,GAAA;AACF,EAAC;AAEYC,MAAAA,0BAA0B,GACrCL,kBAAgD,IAC7C;EACHM,KAAK,CAACC,SAAS,CAAC,MAAM;IACpBP,kBAAkB,CAACQ,UAAU,EAAE,CAAA;AACjC,GAAC,EAAE,CAACR,kBAAkB,CAAC,CAAC,CAAA;AAC1B,EAAC;AAEM,MAAMS,WAAW,GAAG,CAMzB;EACAC,MAAM;EACNV,kBAAkB;EAClBE,WAAW;AACXS,EAAAA,KAAAA;AAMF,CAAC,KAAK;EACJ,OACED,MAAM,CAACE,OAAO,IACd,CAACZ,kBAAkB,CAACG,OAAO,EAAE,IAC7B,CAACO,MAAM,CAACG,UAAU,IAClBC,gBAAgB,CAACZ,WAAW,EAAE,CAACQ,MAAM,CAACK,KAAK,EAAEJ,KAAK,CAAC,CAAC,CAAA;AAExD;;;;"}
1
+ {"version":3,"file":"errorBoundaryUtils.esm.js","sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\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>\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n shouldThrowError(throwOnError, [result.error, query])\n )\n}\n"],"names":["useClearResetErrorBoundary","query"],"mappings":";;;;;AA4BE;AACE;AACA;;AAEA;AACF;AACF;AAEaA;;;AAKX;AACF;AAEO;;;;AAULC;AAMF;;AAOA;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  var React = require('react');
@@ -23,7 +24,7 @@ function _interopNamespaceDefault(e) {
23
24
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
24
25
 
25
26
  const ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
26
- if (options.suspense || options.throwErrors) {
27
+ if (options.suspense || options.throwOnError) {
27
28
  // Prevent retrying failed query if the error boundary has not been reset yet
28
29
  if (!errorResetBoundary.isReset()) {
29
30
  options.retryOnMount = false;
@@ -38,10 +39,10 @@ const useClearResetErrorBoundary = errorResetBoundary => {
38
39
  const getHasError = ({
39
40
  result,
40
41
  errorResetBoundary,
41
- throwErrors,
42
+ throwOnError,
42
43
  query
43
44
  }) => {
44
- return result.isError && !errorResetBoundary.isReset() && !result.isFetching && utils.shouldThrowError(throwErrors, [result.error, query]);
45
+ return result.isError && !errorResetBoundary.isReset() && !result.isFetching && utils.shouldThrowError(throwOnError, [result.error, query]);
45
46
  };
46
47
 
47
48
  exports.ensurePreventErrorBoundaryRetry = ensurePreventErrorBoundaryRetry;
@@ -1 +1 @@
1
- {"version":3,"file":"errorBoundaryUtils.js","sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["import type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowErrors,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\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.throwErrors) {\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 throwErrors,\n query,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwErrors: ThrowErrors<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n shouldThrowError(throwErrors, [result.error, query])\n )\n}\n"],"names":["ensurePreventErrorBoundaryRetry","options","errorResetBoundary","suspense","throwErrors","isReset","retryOnMount","useClearResetErrorBoundary","React","useEffect","clearReset","getHasError","result","query","isError","isFetching","shouldThrowError","error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MAWaA,+BAA+B,GAAG,CAO7CC,OAMC,EACDC,kBAAgD,KAC7C;AACH,EAAA,IAAID,OAAO,CAACE,QAAQ,IAAIF,OAAO,CAACG,WAAW,EAAE;AAC3C;AACA,IAAA,IAAI,CAACF,kBAAkB,CAACG,OAAO,EAAE,EAAE;MACjCJ,OAAO,CAACK,YAAY,GAAG,KAAK,CAAA;AAC9B,KAAA;AACF,GAAA;AACF,EAAC;AAEYC,MAAAA,0BAA0B,GACrCL,kBAAgD,IAC7C;EACHM,gBAAK,CAACC,SAAS,CAAC,MAAM;IACpBP,kBAAkB,CAACQ,UAAU,EAAE,CAAA;AACjC,GAAC,EAAE,CAACR,kBAAkB,CAAC,CAAC,CAAA;AAC1B,EAAC;AAEM,MAAMS,WAAW,GAAG,CAMzB;EACAC,MAAM;EACNV,kBAAkB;EAClBE,WAAW;AACXS,EAAAA,KAAAA;AAMF,CAAC,KAAK;EACJ,OACED,MAAM,CAACE,OAAO,IACd,CAACZ,kBAAkB,CAACG,OAAO,EAAE,IAC7B,CAACO,MAAM,CAACG,UAAU,IAClBC,sBAAgB,CAACZ,WAAW,EAAE,CAACQ,MAAM,CAACK,KAAK,EAAEJ,KAAK,CAAC,CAAC,CAAA;AAExD;;;;;;"}
1
+ {"version":3,"file":"errorBoundaryUtils.js","sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\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>\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n shouldThrowError(throwOnError, [result.error, query])\n )\n}\n"],"names":["useClearResetErrorBoundary","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4BE;AACE;AACA;;AAEA;AACF;AACF;AAEaA;;;AAKX;AACF;AAEO;;;;AAULC;AAMF;;AAOA;;;;"}
@@ -1,8 +1,9 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
  import { shouldThrowError } from './utils.mjs';
3
4
 
4
5
  const ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
5
- if (options.suspense || options.throwErrors) {
6
+ if (options.suspense || options.throwOnError) {
6
7
  // Prevent retrying failed query if the error boundary has not been reset yet
7
8
  if (!errorResetBoundary.isReset()) {
8
9
  options.retryOnMount = false;
@@ -17,10 +18,10 @@ const useClearResetErrorBoundary = errorResetBoundary => {
17
18
  const getHasError = ({
18
19
  result,
19
20
  errorResetBoundary,
20
- throwErrors,
21
+ throwOnError,
21
22
  query
22
23
  }) => {
23
- return result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(throwErrors, [result.error, query]);
24
+ return result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(throwOnError, [result.error, query]);
24
25
  };
25
26
 
26
27
  export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary };
@@ -1 +1 @@
1
- {"version":3,"file":"errorBoundaryUtils.mjs","sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["import type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowErrors,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\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.throwErrors) {\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 throwErrors,\n query,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwErrors: ThrowErrors<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n shouldThrowError(throwErrors, [result.error, query])\n )\n}\n"],"names":["ensurePreventErrorBoundaryRetry","options","errorResetBoundary","suspense","throwErrors","isReset","retryOnMount","useClearResetErrorBoundary","React","useEffect","clearReset","getHasError","result","query","isError","isFetching","shouldThrowError","error"],"mappings":";;;MAWaA,+BAA+B,GAAG,CAO7CC,OAMC,EACDC,kBAAgD,KAC7C;AACH,EAAA,IAAID,OAAO,CAACE,QAAQ,IAAIF,OAAO,CAACG,WAAW,EAAE;AAC3C;AACA,IAAA,IAAI,CAACF,kBAAkB,CAACG,OAAO,EAAE,EAAE;MACjCJ,OAAO,CAACK,YAAY,GAAG,KAAK,CAAA;AAC9B,KAAA;AACF,GAAA;AACF,EAAC;AAEYC,MAAAA,0BAA0B,GACrCL,kBAAgD,IAC7C;EACHM,KAAK,CAACC,SAAS,CAAC,MAAM;IACpBP,kBAAkB,CAACQ,UAAU,EAAE,CAAA;AACjC,GAAC,EAAE,CAACR,kBAAkB,CAAC,CAAC,CAAA;AAC1B,EAAC;AAEM,MAAMS,WAAW,GAAG,CAMzB;EACAC,MAAM;EACNV,kBAAkB;EAClBE,WAAW;AACXS,EAAAA,KAAAA;AAMF,CAAC,KAAK;EACJ,OACED,MAAM,CAACE,OAAO,IACd,CAACZ,kBAAkB,CAACG,OAAO,EAAE,IAC7B,CAACO,MAAM,CAACG,UAAU,IAClBC,gBAAgB,CAACZ,WAAW,EAAE,CAACQ,MAAM,CAACK,KAAK,EAAEJ,KAAK,CAAC,CAAC,CAAA;AAExD;;;;"}
1
+ {"version":3,"file":"errorBoundaryUtils.mjs","sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\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>\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n shouldThrowError(throwOnError, [result.error, query])\n )\n}\n"],"names":["useClearResetErrorBoundary","query"],"mappings":";;;;;AA4BE;AACE;AACA;;AAEA;AACF;AACF;AAEaA;;;AAKX;AACF;AAEO;;;;AAULC;AAMF;;AAOA;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
 
3
4
  const IsRestoringContext = /*#__PURE__*/React.createContext(false);
@@ -1 +1 @@
1
- {"version":3,"file":"isRestoring.esm.js","sources":["../../src/isRestoring.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"names":["IsRestoringContext","React","createContext","useIsRestoring","useContext","IsRestoringProvider","Provider"],"mappings":";;AAGA,MAAMA,kBAAkB,gBAAGC,KAAK,CAACC,aAAa,CAAC,KAAK,CAAC,CAAA;AAE9C,MAAMC,cAAc,GAAG,MAAMF,KAAK,CAACG,UAAU,CAACJ,kBAAkB,EAAC;AAC3DK,MAAAA,mBAAmB,GAAGL,kBAAkB,CAACM;;;;"}
1
+ {"version":3,"file":"isRestoring.esm.js","sources":["../../src/isRestoring.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"names":["IsRestoringProvider"],"mappings":";;;AAGA;AAEO;AACMA;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  var React = require('react');
@@ -1 +1 @@
1
- {"version":3,"file":"isRestoring.js","sources":["../../src/isRestoring.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"names":["IsRestoringContext","React","createContext","useIsRestoring","useContext","IsRestoringProvider","Provider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAMA,kBAAkB,gBAAGC,gBAAK,CAACC,aAAa,CAAC,KAAK,CAAC,CAAA;AAE9C,MAAMC,cAAc,GAAG,MAAMF,gBAAK,CAACG,UAAU,CAACJ,kBAAkB,EAAC;AAC3DK,MAAAA,mBAAmB,GAAGL,kBAAkB,CAACM;;;;;"}
1
+ {"version":3,"file":"isRestoring.js","sources":["../../src/isRestoring.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"names":["IsRestoringProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAEO;AACMA;;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
 
3
4
  const IsRestoringContext = /*#__PURE__*/React.createContext(false);
@@ -1 +1 @@
1
- {"version":3,"file":"isRestoring.mjs","sources":["../../src/isRestoring.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"names":["IsRestoringContext","React","createContext","useIsRestoring","useContext","IsRestoringProvider","Provider"],"mappings":";;AAGA,MAAMA,kBAAkB,gBAAGC,KAAK,CAACC,aAAa,CAAC,KAAK,CAAC,CAAA;AAE9C,MAAMC,cAAc,GAAG,MAAMF,KAAK,CAACG,UAAU,CAACJ,kBAAkB,EAAC;AAC3DK,MAAAA,mBAAmB,GAAGL,kBAAkB,CAACM;;;;"}
1
+ {"version":3,"file":"isRestoring.mjs","sources":["../../src/isRestoring.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"names":["IsRestoringProvider"],"mappings":";;;AAGA;AAEO;AACMA;;"}
@@ -6,4 +6,4 @@ import type { QueryKey } from '@tanstack/query-core';
6
6
  export declare const ensureStaleTime: (defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>) => void;
7
7
  export declare const willFetch: (result: QueryObserverResult<any, any>, isRestoring: boolean) => boolean;
8
8
  export declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any> | undefined, result: QueryObserverResult<any, any>, isRestoring: boolean) => boolean | undefined;
9
- export declare const fetchOptimistic: <TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(defaultedOptions: DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise<void>;
9
+ export declare const fetchOptimistic: <TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(defaultedOptions: DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise<void | QueryObserverResult<TData, TError>>;
@@ -8,16 +8,9 @@ const ensureStaleTime = defaultedOptions => {
8
8
  }
9
9
  };
10
10
  const willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
11
- const shouldSuspend = (defaultedOptions, result, isRestoring) => defaultedOptions?.suspense && willFetch(result, isRestoring);
12
- const fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).then(({
13
- data
14
- }) => {
15
- defaultedOptions.onSuccess?.(data);
16
- defaultedOptions.onSettled?.(data, null);
17
- }).catch(error => {
11
+ const shouldSuspend = (defaultedOptions, result, isRestoring) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && willFetch(result, isRestoring);
12
+ const fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {
18
13
  errorResetBoundary.clearReset();
19
- defaultedOptions.onError?.(error);
20
- defaultedOptions.onSettled?.(undefined, error);
21
14
  });
22
15
 
23
16
  export { ensureStaleTime, fetchOptimistic, shouldSuspend, willFetch };
@@ -1 +1 @@
1
- {"version":3,"file":"suspense.esm.js","sources":["../../src/suspense.ts"],"sourcesContent":["import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\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\nexport const willFetch = (\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions<any, any, any, any, any>\n | undefined,\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n 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"],"names":["ensureStaleTime","defaultedOptions","suspense","staleTime","willFetch","result","isRestoring","isLoading","isFetching","shouldSuspend","fetchOptimistic","observer","errorResetBoundary","then","data","onSuccess","onSettled","catch","error","clearReset","onError","undefined"],"mappings":"AAMaA,MAAAA,eAAe,GAC1BC,gBAAwE,IACrE;EACH,IAAIA,gBAAgB,CAACC,QAAQ,EAAE;AAC7B;AACA;AACA,IAAA,IAAI,OAAOD,gBAAgB,CAACE,SAAS,KAAK,QAAQ,EAAE;MAClDF,gBAAgB,CAACE,SAAS,GAAG,IAAI,CAAA;AACnC,KAAA;AACF,GAAA;AACF,EAAC;MAEYC,SAAS,GAAG,CACvBC,MAAqC,EACrCC,WAAoB,KACjBD,MAAM,CAACE,SAAS,IAAIF,MAAM,CAACG,UAAU,IAAI,CAACF,YAAW;MAE7CG,aAAa,GAAG,CAC3BR,gBAEa,EACbI,MAAqC,EACrCC,WAAoB,KACjBL,gBAAgB,EAAEC,QAAQ,IAAIE,SAAS,CAACC,MAAM,EAAEC,WAAW,EAAC;MAEpDI,eAAe,GAAG,CAO7BT,gBAMC,EACDU,QAA2E,EAC3EC,kBAAgD,KAEhDD,QAAQ,CACLD,eAAe,CAACT,gBAAgB,CAAC,CACjCY,IAAI,CAAC,CAAC;AAAEC,EAAAA,IAAAA;AAAK,CAAC,KAAK;AAClBb,EAAAA,gBAAgB,CAACc,SAAS,GAAGD,IAAI,CAAU,CAAA;AAC3Cb,EAAAA,gBAAgB,CAACe,SAAS,GAAGF,IAAI,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAC,CACDG,KAAK,CAAEC,KAAK,IAAK;EAChBN,kBAAkB,CAACO,UAAU,EAAE,CAAA;AAC/BlB,EAAAA,gBAAgB,CAACmB,OAAO,GAAGF,KAAK,CAAC,CAAA;AACjCjB,EAAAA,gBAAgB,CAACe,SAAS,GAAGK,SAAS,EAAEH,KAAK,CAAC,CAAA;AAChD,CAAC;;;;"}
1
+ {"version":3,"file":"suspense.esm.js","sources":["../../src/suspense.ts"],"sourcesContent":["import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\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\nexport const willFetch = (\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions<any, any, any, any, any>\n | undefined,\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"names":["ensureStaleTime","defaultedOptions","suspense","staleTime","willFetch","result","isRestoring","isLoading","isFetching","shouldSuspend","fetchOptimistic","observer","errorResetBoundary","catch","clearReset"],"mappings":"AAMaA,MAAAA,eAAe,GAC1BC,gBAAwE,IACrE;EACH,IAAIA,gBAAgB,CAACC,QAAQ,EAAE;AAC7B;AACA;AACA,IAAA,IAAI,OAAOD,gBAAgB,CAACE,SAAS,KAAK,QAAQ,EAAE;MAClDF,gBAAgB,CAACE,SAAS,GAAG,IAAI,CAAA;AACnC,KAAA;AACF,GAAA;AACF,EAAC;MAEYC,SAAS,GAAG,CACvBC,MAAqC,EACrCC,WAAoB,KACjBD,MAAM,CAACE,SAAS,IAAIF,MAAM,CAACG,UAAU,IAAI,CAACF,YAAW;AAEnD,MAAMG,aAAa,GAAG,CAC3BR,gBAEa,EACbI,MAAqC,EACrCC,WAAoB,KACjB,CAAAL,gBAAgB,IAAhBA,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,gBAAgB,CAAEC,QAAQ,KAAIE,SAAS,CAACC,MAAM,EAAEC,WAAW,EAAC;MAEpDI,eAAe,GAAG,CAO7BT,gBAMC,EACDU,QAA2E,EAC3EC,kBAAgD,KAEhDD,QAAQ,CAACD,eAAe,CAACT,gBAAgB,CAAC,CAACY,KAAK,CAAC,MAAM;EACrDD,kBAAkB,CAACE,UAAU,EAAE,CAAA;AACjC,CAAC;;;;"}
@@ -10,16 +10,9 @@ const ensureStaleTime = defaultedOptions => {
10
10
  }
11
11
  };
12
12
  const willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
13
- const shouldSuspend = (defaultedOptions, result, isRestoring) => defaultedOptions?.suspense && willFetch(result, isRestoring);
14
- const fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).then(({
15
- data
16
- }) => {
17
- defaultedOptions.onSuccess?.(data);
18
- defaultedOptions.onSettled?.(data, null);
19
- }).catch(error => {
13
+ const shouldSuspend = (defaultedOptions, result, isRestoring) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && willFetch(result, isRestoring);
14
+ const fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {
20
15
  errorResetBoundary.clearReset();
21
- defaultedOptions.onError?.(error);
22
- defaultedOptions.onSettled?.(undefined, error);
23
16
  });
24
17
 
25
18
  exports.ensureStaleTime = ensureStaleTime;
@@ -1 +1 @@
1
- {"version":3,"file":"suspense.js","sources":["../../src/suspense.ts"],"sourcesContent":["import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\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\nexport const willFetch = (\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions<any, any, any, any, any>\n | undefined,\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n 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"],"names":["ensureStaleTime","defaultedOptions","suspense","staleTime","willFetch","result","isRestoring","isLoading","isFetching","shouldSuspend","fetchOptimistic","observer","errorResetBoundary","then","data","onSuccess","onSettled","catch","error","clearReset","onError","undefined"],"mappings":";;AAMaA,MAAAA,eAAe,GAC1BC,gBAAwE,IACrE;EACH,IAAIA,gBAAgB,CAACC,QAAQ,EAAE;AAC7B;AACA;AACA,IAAA,IAAI,OAAOD,gBAAgB,CAACE,SAAS,KAAK,QAAQ,EAAE;MAClDF,gBAAgB,CAACE,SAAS,GAAG,IAAI,CAAA;AACnC,KAAA;AACF,GAAA;AACF,EAAC;MAEYC,SAAS,GAAG,CACvBC,MAAqC,EACrCC,WAAoB,KACjBD,MAAM,CAACE,SAAS,IAAIF,MAAM,CAACG,UAAU,IAAI,CAACF,YAAW;MAE7CG,aAAa,GAAG,CAC3BR,gBAEa,EACbI,MAAqC,EACrCC,WAAoB,KACjBL,gBAAgB,EAAEC,QAAQ,IAAIE,SAAS,CAACC,MAAM,EAAEC,WAAW,EAAC;MAEpDI,eAAe,GAAG,CAO7BT,gBAMC,EACDU,QAA2E,EAC3EC,kBAAgD,KAEhDD,QAAQ,CACLD,eAAe,CAACT,gBAAgB,CAAC,CACjCY,IAAI,CAAC,CAAC;AAAEC,EAAAA,IAAAA;AAAK,CAAC,KAAK;AAClBb,EAAAA,gBAAgB,CAACc,SAAS,GAAGD,IAAI,CAAU,CAAA;AAC3Cb,EAAAA,gBAAgB,CAACe,SAAS,GAAGF,IAAI,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAC,CACDG,KAAK,CAAEC,KAAK,IAAK;EAChBN,kBAAkB,CAACO,UAAU,EAAE,CAAA;AAC/BlB,EAAAA,gBAAgB,CAACmB,OAAO,GAAGF,KAAK,CAAC,CAAA;AACjCjB,EAAAA,gBAAgB,CAACe,SAAS,GAAGK,SAAS,EAAEH,KAAK,CAAC,CAAA;AAChD,CAAC;;;;;;;"}
1
+ {"version":3,"file":"suspense.js","sources":["../../src/suspense.ts"],"sourcesContent":["import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\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\nexport const willFetch = (\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions<any, any, any, any, any>\n | undefined,\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"names":["ensureStaleTime","defaultedOptions","suspense","staleTime","willFetch","result","isRestoring","isLoading","isFetching","shouldSuspend","fetchOptimistic","observer","errorResetBoundary","catch","clearReset"],"mappings":";;AAMaA,MAAAA,eAAe,GAC1BC,gBAAwE,IACrE;EACH,IAAIA,gBAAgB,CAACC,QAAQ,EAAE;AAC7B;AACA;AACA,IAAA,IAAI,OAAOD,gBAAgB,CAACE,SAAS,KAAK,QAAQ,EAAE;MAClDF,gBAAgB,CAACE,SAAS,GAAG,IAAI,CAAA;AACnC,KAAA;AACF,GAAA;AACF,EAAC;MAEYC,SAAS,GAAG,CACvBC,MAAqC,EACrCC,WAAoB,KACjBD,MAAM,CAACE,SAAS,IAAIF,MAAM,CAACG,UAAU,IAAI,CAACF,YAAW;AAEnD,MAAMG,aAAa,GAAG,CAC3BR,gBAEa,EACbI,MAAqC,EACrCC,WAAoB,KACjB,CAAAL,gBAAgB,IAAhBA,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,gBAAgB,CAAEC,QAAQ,KAAIE,SAAS,CAACC,MAAM,EAAEC,WAAW,EAAC;MAEpDI,eAAe,GAAG,CAO7BT,gBAMC,EACDU,QAA2E,EAC3EC,kBAAgD,KAEhDD,QAAQ,CAACD,eAAe,CAACT,gBAAgB,CAAC,CAACY,KAAK,CAAC,MAAM;EACrDD,kBAAkB,CAACE,UAAU,EAAE,CAAA;AACjC,CAAC;;;;;;;"}
@@ -9,15 +9,8 @@ const ensureStaleTime = defaultedOptions => {
9
9
  };
10
10
  const willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
11
11
  const shouldSuspend = (defaultedOptions, result, isRestoring) => defaultedOptions?.suspense && willFetch(result, isRestoring);
12
- const fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).then(({
13
- data
14
- }) => {
15
- defaultedOptions.onSuccess?.(data);
16
- defaultedOptions.onSettled?.(data, null);
17
- }).catch(error => {
12
+ const fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {
18
13
  errorResetBoundary.clearReset();
19
- defaultedOptions.onError?.(error);
20
- defaultedOptions.onSettled?.(undefined, error);
21
14
  });
22
15
 
23
16
  export { ensureStaleTime, fetchOptimistic, shouldSuspend, willFetch };
@@ -1 +1 @@
1
- {"version":3,"file":"suspense.mjs","sources":["../../src/suspense.ts"],"sourcesContent":["import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\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\nexport const willFetch = (\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions<any, any, any, any, any>\n | undefined,\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n 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"],"names":["ensureStaleTime","defaultedOptions","suspense","staleTime","willFetch","result","isRestoring","isLoading","isFetching","shouldSuspend","fetchOptimistic","observer","errorResetBoundary","then","data","onSuccess","onSettled","catch","error","clearReset","onError","undefined"],"mappings":"AAMaA,MAAAA,eAAe,GAC1BC,gBAAwE,IACrE;EACH,IAAIA,gBAAgB,CAACC,QAAQ,EAAE;AAC7B;AACA;AACA,IAAA,IAAI,OAAOD,gBAAgB,CAACE,SAAS,KAAK,QAAQ,EAAE;MAClDF,gBAAgB,CAACE,SAAS,GAAG,IAAI,CAAA;AACnC,KAAA;AACF,GAAA;AACF,EAAC;MAEYC,SAAS,GAAG,CACvBC,MAAqC,EACrCC,WAAoB,KACjBD,MAAM,CAACE,SAAS,IAAIF,MAAM,CAACG,UAAU,IAAI,CAACF,YAAW;MAE7CG,aAAa,GAAG,CAC3BR,gBAEa,EACbI,MAAqC,EACrCC,WAAoB,KACjBL,gBAAgB,EAAEC,QAAQ,IAAIE,SAAS,CAACC,MAAM,EAAEC,WAAW,EAAC;MAEpDI,eAAe,GAAG,CAO7BT,gBAMC,EACDU,QAA2E,EAC3EC,kBAAgD,KAEhDD,QAAQ,CACLD,eAAe,CAACT,gBAAgB,CAAC,CACjCY,IAAI,CAAC,CAAC;AAAEC,EAAAA,IAAAA;AAAK,CAAC,KAAK;AAClBb,EAAAA,gBAAgB,CAACc,SAAS,GAAGD,IAAI,CAAU,CAAA;AAC3Cb,EAAAA,gBAAgB,CAACe,SAAS,GAAGF,IAAI,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAC,CACDG,KAAK,CAAEC,KAAK,IAAK;EAChBN,kBAAkB,CAACO,UAAU,EAAE,CAAA;AAC/BlB,EAAAA,gBAAgB,CAACmB,OAAO,GAAGF,KAAK,CAAC,CAAA;AACjCjB,EAAAA,gBAAgB,CAACe,SAAS,GAAGK,SAAS,EAAEH,KAAK,CAAC,CAAA;AAChD,CAAC;;;;"}
1
+ {"version":3,"file":"suspense.mjs","sources":["../../src/suspense.ts"],"sourcesContent":["import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\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\nexport const willFetch = (\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions<any, any, any, any, any>\n | undefined,\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"names":["ensureStaleTime","defaultedOptions","suspense","staleTime","willFetch","result","isRestoring","isLoading","isFetching","shouldSuspend","fetchOptimistic","observer","errorResetBoundary","catch","clearReset"],"mappings":"AAMaA,MAAAA,eAAe,GAC1BC,gBAAwE,IACrE;EACH,IAAIA,gBAAgB,CAACC,QAAQ,EAAE;AAC7B;AACA;AACA,IAAA,IAAI,OAAOD,gBAAgB,CAACE,SAAS,KAAK,QAAQ,EAAE;MAClDF,gBAAgB,CAACE,SAAS,GAAG,IAAI,CAAA;AACnC,KAAA;AACF,GAAA;AACF,EAAC;MAEYC,SAAS,GAAG,CACvBC,MAAqC,EACrCC,WAAoB,KACjBD,MAAM,CAACE,SAAS,IAAIF,MAAM,CAACG,UAAU,IAAI,CAACF,YAAW;MAE7CG,aAAa,GAAG,CAC3BR,gBAEa,EACbI,MAAqC,EACrCC,WAAoB,KACjBL,gBAAgB,EAAEC,QAAQ,IAAIE,SAAS,CAACC,MAAM,EAAEC,WAAW,EAAC;MAEpDI,eAAe,GAAG,CAO7BT,gBAMC,EACDU,QAA2E,EAC3EC,kBAAgD,KAEhDD,QAAQ,CAACD,eAAe,CAACT,gBAAgB,CAAC,CAACY,KAAK,CAAC,MAAM;EACrDD,kBAAkB,CAACE,UAAU,EAAE,CAAA;AACjC,CAAC;;;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
  import { notifyManager } from '@tanstack/query-core';
3
4
  import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary.esm.js';
@@ -14,17 +15,6 @@ function useBaseQuery(options, Observer, queryClient) {
14
15
 
15
16
  // Make sure results are optimistically set in fetching state before subscribing or updating options
16
17
  defaultedOptions._optimisticResults = isRestoring ? 'isRestoring' : 'optimistic';
17
-
18
- // Include callbacks in batch renders
19
- if (defaultedOptions.onError) {
20
- defaultedOptions.onError = notifyManager.batchCalls(defaultedOptions.onError);
21
- }
22
- if (defaultedOptions.onSuccess) {
23
- defaultedOptions.onSuccess = notifyManager.batchCalls(defaultedOptions.onSuccess);
24
- }
25
- if (defaultedOptions.onSettled) {
26
- defaultedOptions.onSettled = notifyManager.batchCalls(defaultedOptions.onSettled);
27
- }
28
18
  ensureStaleTime(defaultedOptions);
29
19
  ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);
30
20
  useClearResetErrorBoundary(errorResetBoundary);
@@ -48,7 +38,7 @@ function useBaseQuery(options, Observer, queryClient) {
48
38
  if (getHasError({
49
39
  result,
50
40
  errorResetBoundary,
51
- throwErrors: defaultedOptions.throwErrors,
41
+ throwOnError: defaultedOptions.throwOnError,
52
42
  query: observer.getCurrentQuery()
53
43
  })) {
54
44
  throw result.error;
@@ -1 +1 @@
1
- {"version":3,"file":"useBaseQuery.esm.js","sources":["../../src/useBaseQuery.ts"],"sourcesContent":["import * as React from 'react'\n\nimport type { QueryClient, QueryKey, QueryObserver } from '@tanstack/query-core'\nimport { notifyManager } from '@tanstack/query-core'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport { useQueryClient } from './QueryClientProvider'\nimport type { UseBaseQueryOptions } from './types'\nimport { useIsRestoring } from './isRestoring'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport { ensureStaleTime, shouldSuspend, fetchOptimistic } from './suspense'\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 queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const defaultedOptions = client.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 ensureStaleTime(defaultedOptions)\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary)\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new Observer<TQueryFnData, TError, TData, TQueryData, TQueryKey>(\n client,\n defaultedOptions,\n ),\n )\n\n const result = observer.getOptimisticResult(defaultedOptions)\n\n React.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.setOptions(defaultedOptions, { listeners: false })\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (shouldSuspend(defaultedOptions, result, isRestoring)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n }\n\n // Handle error boundary\n if (\n getHasError({\n result,\n errorResetBoundary,\n throwErrors: defaultedOptions.throwErrors,\n query: 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"],"names":["useBaseQuery","options","Observer","queryClient","client","useQueryClient","isRestoring","useIsRestoring","errorResetBoundary","useQueryErrorResetBoundary","defaultedOptions","defaultQueryOptions","_optimisticResults","onError","notifyManager","batchCalls","onSuccess","onSettled","ensureStaleTime","ensurePreventErrorBoundaryRetry","useClearResetErrorBoundary","observer","React","useState","result","getOptimisticResult","useSyncExternalStore","useCallback","onStoreChange","undefined","subscribe","getCurrentResult","useEffect","setOptions","listeners","shouldSuspend","fetchOptimistic","getHasError","throwErrors","query","getCurrentQuery","error","notifyOnChangeProps","trackResult"],"mappings":";;;;;;;;AAeO,SAASA,YAAY,CAO1BC,OAMC,EACDC,QAA8B,EAC9BC,WAAyB,EACzB;AACA,EAAA,MAAMC,MAAM,GAAGC,cAAc,CAACF,WAAW,CAAC,CAAA;EAC1C,MAAMG,WAAW,GAAGC,cAAc,EAAE,CAAA;EACpC,MAAMC,kBAAkB,GAAGC,0BAA0B,EAAE,CAAA;AACvD,EAAA,MAAMC,gBAAgB,GAAGN,MAAM,CAACO,mBAAmB,CAACV,OAAO,CAAC,CAAA;;AAE5D;AACAS,EAAAA,gBAAgB,CAACE,kBAAkB,GAAGN,WAAW,GAC7C,aAAa,GACb,YAAY,CAAA;;AAEhB;EACA,IAAII,gBAAgB,CAACG,OAAO,EAAE;IAC5BH,gBAAgB,CAACG,OAAO,GAAGC,aAAa,CAACC,UAAU,CACjDL,gBAAgB,CAACG,OAAO,CACzB,CAAA;AACH,GAAA;EAEA,IAAIH,gBAAgB,CAACM,SAAS,EAAE;IAC9BN,gBAAgB,CAACM,SAAS,GAAGF,aAAa,CAACC,UAAU,CACnDL,gBAAgB,CAACM,SAAS,CAC3B,CAAA;AACH,GAAA;EAEA,IAAIN,gBAAgB,CAACO,SAAS,EAAE;IAC9BP,gBAAgB,CAACO,SAAS,GAAGH,aAAa,CAACC,UAAU,CACnDL,gBAAgB,CAACO,SAAS,CAC3B,CAAA;AACH,GAAA;EAEAC,eAAe,CAACR,gBAAgB,CAAC,CAAA;AACjCS,EAAAA,+BAA+B,CAACT,gBAAgB,EAAEF,kBAAkB,CAAC,CAAA;EAErEY,0BAA0B,CAACZ,kBAAkB,CAAC,CAAA;AAE9C,EAAA,MAAM,CAACa,QAAQ,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAC/B,MACE,IAAIrB,QAAQ,CACVE,MAAM,EACNM,gBAAgB,CACjB,CACJ,CAAA;AAED,EAAA,MAAMc,MAAM,GAAGH,QAAQ,CAACI,mBAAmB,CAACf,gBAAgB,CAAC,CAAA;EAE7DY,KAAK,CAACI,oBAAoB,CACxBJ,KAAK,CAACK,WAAW,CACdC,aAAa,IACZtB,WAAW,GACP,MAAMuB,SAAS,GACfR,QAAQ,CAACS,SAAS,CAAChB,aAAa,CAACC,UAAU,CAACa,aAAa,CAAC,CAAC,EACjE,CAACP,QAAQ,EAAEf,WAAW,CAAC,CACxB,EACD,MAAMe,QAAQ,CAACU,gBAAgB,EAAE,EACjC,MAAMV,QAAQ,CAACU,gBAAgB,EAAE,CAClC,CAAA;EAEDT,KAAK,CAACU,SAAS,CAAC,MAAM;AACpB;AACA;AACAX,IAAAA,QAAQ,CAACY,UAAU,CAACvB,gBAAgB,EAAE;AAAEwB,MAAAA,SAAS,EAAE,KAAA;AAAM,KAAC,CAAC,CAAA;AAC7D,GAAC,EAAE,CAACxB,gBAAgB,EAAEW,QAAQ,CAAC,CAAC,CAAA;;AAEhC;EACA,IAAIc,aAAa,CAACzB,gBAAgB,EAAEc,MAAM,EAAElB,WAAW,CAAC,EAAE;AACxD,IAAA,MAAM8B,eAAe,CAAC1B,gBAAgB,EAAEW,QAAQ,EAAEb,kBAAkB,CAAC,CAAA;AACvE,GAAA;;AAEA;AACA,EAAA,IACE6B,WAAW,CAAC;IACVb,MAAM;IACNhB,kBAAkB;IAClB8B,WAAW,EAAE5B,gBAAgB,CAAC4B,WAAW;IACzCC,KAAK,EAAElB,QAAQ,CAACmB,eAAe,EAAA;AACjC,GAAC,CAAC,EACF;IACA,MAAMhB,MAAM,CAACiB,KAAK,CAAA;AACpB,GAAA;;AAEA;AACA,EAAA,OAAO,CAAC/B,gBAAgB,CAACgC,mBAAmB,GACxCrB,QAAQ,CAACsB,WAAW,CAACnB,MAAM,CAAC,GAC5BA,MAAM,CAAA;AACZ;;;;"}
1
+ {"version":3,"file":"useBaseQuery.esm.js","sources":["../../src/useBaseQuery.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient, QueryKey, QueryObserver } from '@tanstack/query-core'\nimport { notifyManager } from '@tanstack/query-core'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport { useQueryClient } from './QueryClientProvider'\nimport type { UseBaseQueryOptions } from './types'\nimport { useIsRestoring } from './isRestoring'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport { ensureStaleTime, shouldSuspend, fetchOptimistic } from './suspense'\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 queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const defaultedOptions = client.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 ensureStaleTime(defaultedOptions)\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary)\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new Observer<TQueryFnData, TError, TData, TQueryData, TQueryKey>(\n client,\n defaultedOptions,\n ),\n )\n\n const result = observer.getOptimisticResult(defaultedOptions)\n\n React.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.setOptions(defaultedOptions, { listeners: false })\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (shouldSuspend(defaultedOptions, result, isRestoring)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n }\n\n // Handle error boundary\n if (\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query: 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"],"names":["defaultedOptions","ensurePreventErrorBoundaryRetry","observer","listeners"],"mappings":";;;;;;;;;AAgBO;AAiBL;;;AAGA;;AAEA;AACAA;;AAKAC;;AAIA;AAQA;;;AAeE;AACA;AACAC;AAAwCC;AAAiB;AAC3D;;AAEA;;AAEE;AACF;;AAEA;AACA;;;;;AAME;;AAGF;;AAEA;AACA;AAGF;;"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  var React = require('react');
@@ -35,17 +36,6 @@ function useBaseQuery(options, Observer, queryClient) {
35
36
 
36
37
  // Make sure results are optimistically set in fetching state before subscribing or updating options
37
38
  defaultedOptions._optimisticResults = isRestoring$1 ? 'isRestoring' : 'optimistic';
38
-
39
- // Include callbacks in batch renders
40
- if (defaultedOptions.onError) {
41
- defaultedOptions.onError = queryCore.notifyManager.batchCalls(defaultedOptions.onError);
42
- }
43
- if (defaultedOptions.onSuccess) {
44
- defaultedOptions.onSuccess = queryCore.notifyManager.batchCalls(defaultedOptions.onSuccess);
45
- }
46
- if (defaultedOptions.onSettled) {
47
- defaultedOptions.onSettled = queryCore.notifyManager.batchCalls(defaultedOptions.onSettled);
48
- }
49
39
  suspense.ensureStaleTime(defaultedOptions);
50
40
  errorBoundaryUtils.ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);
51
41
  errorBoundaryUtils.useClearResetErrorBoundary(errorResetBoundary);
@@ -69,7 +59,7 @@ function useBaseQuery(options, Observer, queryClient) {
69
59
  if (errorBoundaryUtils.getHasError({
70
60
  result,
71
61
  errorResetBoundary,
72
- throwErrors: defaultedOptions.throwErrors,
62
+ throwOnError: defaultedOptions.throwOnError,
73
63
  query: observer.getCurrentQuery()
74
64
  })) {
75
65
  throw result.error;