@tanstack/react-query 4.20.3 → 4.20.9

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.
@@ -356,6 +356,8 @@
356
356
  if (typeof AbortController === 'function') {
357
357
  return new AbortController();
358
358
  }
359
+
360
+ return;
359
361
  }
360
362
  function replaceData(prevData, data, options) {
361
363
  // Use prev data if an isDataEqual function is defined and returns `true`
@@ -390,6 +392,8 @@
390
392
  window.removeEventListener('focus', listener);
391
393
  };
392
394
  }
395
+
396
+ return;
393
397
  };
394
398
  }
395
399
 
@@ -471,6 +475,8 @@
471
475
  window.removeEventListener('offline', listener);
472
476
  };
473
477
  }
478
+
479
+ return;
474
480
  };
475
481
  }
476
482
 
@@ -658,6 +664,8 @@
658
664
  if (shouldPause()) {
659
665
  return pause();
660
666
  }
667
+
668
+ return;
661
669
  }).then(() => {
662
670
  if (isRetryCancelled) {
663
671
  reject(error);
@@ -1845,6 +1853,8 @@
1845
1853
  const nextPageParam = getNextPageParam(options, pages);
1846
1854
  return typeof nextPageParam !== 'undefined' && nextPageParam !== null && nextPageParam !== false;
1847
1855
  }
1856
+
1857
+ return;
1848
1858
  }
1849
1859
  /**
1850
1860
  * Checks if there is a previous page.
@@ -1856,6 +1866,8 @@
1856
1866
  const previousPageParam = getPreviousPageParam(options, pages);
1857
1867
  return typeof previousPageParam !== 'undefined' && previousPageParam !== null && previousPageParam !== false;
1858
1868
  }
1869
+
1870
+ return;
1859
1871
  }
1860
1872
 
1861
1873
  // CLASS
@@ -1867,6 +1879,7 @@
1867
1879
  this.defaultOptions = config.defaultOptions || {};
1868
1880
  this.queryDefaults = [];
1869
1881
  this.mutationDefaults = [];
1882
+ this.mountCount = 0;
1870
1883
 
1871
1884
  if (config.logger) {
1872
1885
  this.logger.error("Passing a custom logger has been deprecated and will be removed in the next major version.");
@@ -1874,6 +1887,8 @@
1874
1887
  }
1875
1888
 
1876
1889
  mount() {
1890
+ this.mountCount++;
1891
+ if (this.mountCount !== 1) return;
1877
1892
  this.unsubscribeFocus = focusManager.subscribe(() => {
1878
1893
  if (focusManager.isFocused()) {
1879
1894
  this.resumePausedMutations();
@@ -1891,8 +1906,12 @@
1891
1906
  unmount() {
1892
1907
  var _this$unsubscribeFocu, _this$unsubscribeOnli;
1893
1908
 
1909
+ this.mountCount--;
1910
+ if (this.mountCount !== 0) return;
1894
1911
  (_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this);
1912
+ this.unsubscribeFocus = undefined;
1895
1913
  (_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this);
1914
+ this.unsubscribeOnline = undefined;
1896
1915
  }
1897
1916
 
1898
1917
  isFetching(arg1, arg2) {