@tanstack/query-core 5.0.0-alpha.21 → 5.0.0-alpha.24

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 (64) hide show
  1. package/build/lib/focusManager.d.ts +1 -0
  2. package/build/lib/hydration.d.ts +1 -0
  3. package/build/lib/index.d.ts +1 -0
  4. package/build/lib/infiniteQueryBehavior.d.ts +1 -0
  5. package/build/lib/infiniteQueryObserver.d.ts +1 -0
  6. package/build/lib/mutation.d.ts +1 -0
  7. package/build/lib/mutationCache.d.ts +1 -0
  8. package/build/lib/mutationObserver.d.ts +1 -0
  9. package/build/lib/notifyManager.d.ts +1 -0
  10. package/build/lib/onlineManager.d.ts +1 -0
  11. package/build/lib/queriesObserver.d.ts +1 -0
  12. package/build/lib/query.d.ts +1 -0
  13. package/build/lib/query.esm.js +1 -1
  14. package/build/lib/query.esm.js.map +1 -1
  15. package/build/lib/query.js +1 -1
  16. package/build/lib/query.js.map +1 -1
  17. package/build/lib/query.mjs +1 -1
  18. package/build/lib/query.mjs.map +1 -1
  19. package/build/lib/queryCache.d.ts +1 -0
  20. package/build/lib/queryClient.d.ts +1 -0
  21. package/build/lib/queryClient.esm.js +2 -2
  22. package/build/lib/queryClient.esm.js.map +1 -1
  23. package/build/lib/queryClient.js +2 -2
  24. package/build/lib/queryClient.js.map +1 -1
  25. package/build/lib/queryClient.mjs +2 -2
  26. package/build/lib/queryClient.mjs.map +1 -1
  27. package/build/lib/queryObserver.d.ts +1 -0
  28. package/build/lib/queryObserver.esm.js +3 -3
  29. package/build/lib/queryObserver.esm.js.map +1 -1
  30. package/build/lib/queryObserver.js +3 -3
  31. package/build/lib/queryObserver.js.map +1 -1
  32. package/build/lib/queryObserver.mjs +2 -2
  33. package/build/lib/queryObserver.mjs.map +1 -1
  34. package/build/lib/removable.d.ts +1 -0
  35. package/build/lib/retryer.d.ts +1 -0
  36. package/build/lib/subscribable.d.ts +1 -0
  37. package/build/lib/tests/focusManager.test.d.ts +1 -0
  38. package/build/lib/tests/hydration.test.d.ts +1 -0
  39. package/build/lib/tests/infiniteQueryBehavior.test.d.ts +1 -0
  40. package/build/lib/tests/infiniteQueryObserver.test.d.ts +1 -0
  41. package/build/lib/tests/mutationCache.test.d.ts +1 -0
  42. package/build/lib/tests/mutationObserver.test.d.ts +1 -0
  43. package/build/lib/tests/mutations.test.d.ts +1 -0
  44. package/build/lib/tests/notifyManager.test.d.ts +1 -0
  45. package/build/lib/tests/onlineManager.test.d.ts +1 -0
  46. package/build/lib/tests/queriesObserver.test.d.ts +1 -0
  47. package/build/lib/tests/query.test.d.ts +1 -0
  48. package/build/lib/tests/queryCache.test.d.ts +1 -0
  49. package/build/lib/tests/queryClient.test.d.ts +1 -0
  50. package/build/lib/tests/queryObserver.test.d.ts +1 -0
  51. package/build/lib/tests/utils.d.ts +1 -0
  52. package/build/lib/tests/utils.test.d.ts +1 -0
  53. package/build/lib/types.d.ts +7 -6
  54. package/build/lib/utils.d.ts +1 -0
  55. package/build/umd/index.development.js +5 -5
  56. package/build/umd/index.development.js.map +1 -1
  57. package/build/umd/index.production.js +1 -1
  58. package/build/umd/index.production.js.map +1 -1
  59. package/package.json +1 -1
  60. package/src/query.ts +1 -1
  61. package/src/queryClient.ts +2 -2
  62. package/src/queryObserver.ts +9 -7
  63. package/src/tests/query.test.tsx +1 -1
  64. package/src/types.ts +6 -6
@@ -907,7 +907,7 @@
907
907
  {
908
908
  console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`);
909
909
  }
910
- onError(new Error('undefined'));
910
+ onError(new Error(`${this.queryHash} data is undefined`));
911
911
  return;
912
912
  }
913
913
  this.setData(data);
@@ -1821,8 +1821,8 @@
1821
1821
  if (typeof defaultedOptions.refetchOnReconnect === 'undefined') {
1822
1822
  defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== 'always';
1823
1823
  }
1824
- if (typeof defaultedOptions.throwErrors === 'undefined') {
1825
- defaultedOptions.throwErrors = !!defaultedOptions.suspense;
1824
+ if (typeof defaultedOptions.throwOnError === 'undefined') {
1825
+ defaultedOptions.throwOnError = !!defaultedOptions.suspense;
1826
1826
  }
1827
1827
  return defaultedOptions;
1828
1828
  }
@@ -2012,7 +2012,7 @@
2012
2012
  }, timeout);
2013
2013
  }
2014
2014
  #computeRefetchInterval() {
2015
- return typeof this.options.refetchInterval === 'function' ? this.options.refetchInterval(this.#currentResult.data, this.#currentQuery) : this.options.refetchInterval ?? false;
2015
+ return (typeof this.options.refetchInterval === 'function' ? this.options.refetchInterval(this.#currentResult.data, this.#currentQuery) : this.options.refetchInterval) ?? false;
2016
2016
  }
2017
2017
  #updateRefetchInterval(nextInterval) {
2018
2018
  this.#clearRefetchInterval();
@@ -2190,7 +2190,7 @@
2190
2190
  return true;
2191
2191
  }
2192
2192
  const includedProps = new Set(notifyOnChangeProps ?? this.#trackedProps);
2193
- if (this.options.throwErrors) {
2193
+ if (this.options.throwOnError) {
2194
2194
  includedProps.add('error');
2195
2195
  }
2196
2196
  return Object.keys(this.#currentResult).some(key => {