@tanstack/query-core 4.20.4 → 4.21.0
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.
- package/build/lib/queryClient.d.ts +1 -0
- package/build/lib/queryClient.esm.js +7 -0
- package/build/lib/queryClient.esm.js.map +1 -1
- package/build/lib/queryClient.js +7 -0
- package/build/lib/queryClient.js.map +1 -1
- package/build/lib/queryClient.mjs +7 -0
- package/build/lib/queryClient.mjs.map +1 -1
- package/build/umd/index.development.js +7 -0
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/queryClient.ts +11 -0
- package/src/tests/queryClient.test.tsx +70 -0
|
@@ -1855,6 +1855,7 @@
|
|
|
1855
1855
|
this.defaultOptions = config.defaultOptions || {};
|
|
1856
1856
|
this.queryDefaults = [];
|
|
1857
1857
|
this.mutationDefaults = [];
|
|
1858
|
+
this.mountCount = 0;
|
|
1858
1859
|
|
|
1859
1860
|
if (config.logger) {
|
|
1860
1861
|
this.logger.error("Passing a custom logger has been deprecated and will be removed in the next major version.");
|
|
@@ -1862,6 +1863,8 @@
|
|
|
1862
1863
|
}
|
|
1863
1864
|
|
|
1864
1865
|
mount() {
|
|
1866
|
+
this.mountCount++;
|
|
1867
|
+
if (this.mountCount !== 1) return;
|
|
1865
1868
|
this.unsubscribeFocus = focusManager.subscribe(() => {
|
|
1866
1869
|
if (focusManager.isFocused()) {
|
|
1867
1870
|
this.resumePausedMutations();
|
|
@@ -1879,8 +1882,12 @@
|
|
|
1879
1882
|
unmount() {
|
|
1880
1883
|
var _this$unsubscribeFocu, _this$unsubscribeOnli;
|
|
1881
1884
|
|
|
1885
|
+
this.mountCount--;
|
|
1886
|
+
if (this.mountCount !== 0) return;
|
|
1882
1887
|
(_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this);
|
|
1888
|
+
this.unsubscribeFocus = undefined;
|
|
1883
1889
|
(_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this);
|
|
1890
|
+
this.unsubscribeOnline = undefined;
|
|
1884
1891
|
}
|
|
1885
1892
|
|
|
1886
1893
|
isFetching(arg1, arg2) {
|