@tanstack/react-query 4.24.3 → 4.24.6
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.
|
@@ -605,9 +605,13 @@
|
|
|
605
605
|
const pause = () => {
|
|
606
606
|
return new Promise(continueResolve => {
|
|
607
607
|
continueFn = value => {
|
|
608
|
-
|
|
609
|
-
|
|
608
|
+
const canContinue = isResolved || !shouldPause();
|
|
609
|
+
|
|
610
|
+
if (canContinue) {
|
|
611
|
+
continueResolve(value);
|
|
610
612
|
}
|
|
613
|
+
|
|
614
|
+
return canContinue;
|
|
611
615
|
};
|
|
612
616
|
|
|
613
617
|
config.onPause == null ? void 0 : config.onPause();
|
|
@@ -687,7 +691,8 @@
|
|
|
687
691
|
promise,
|
|
688
692
|
cancel,
|
|
689
693
|
continue: () => {
|
|
690
|
-
continueFn == null ? void 0 : continueFn();
|
|
694
|
+
const didContinue = continueFn == null ? void 0 : continueFn();
|
|
695
|
+
return didContinue ? promise : Promise.resolve();
|
|
691
696
|
},
|
|
692
697
|
cancelRetry,
|
|
693
698
|
continueRetry
|
|
@@ -1463,12 +1468,9 @@
|
|
|
1463
1468
|
}
|
|
1464
1469
|
|
|
1465
1470
|
continue() {
|
|
1466
|
-
|
|
1467
|
-
this.retryer.continue();
|
|
1468
|
-
return this.retryer.promise;
|
|
1469
|
-
}
|
|
1471
|
+
var _this$retryer$continu, _this$retryer;
|
|
1470
1472
|
|
|
1471
|
-
return this.execute();
|
|
1473
|
+
return (_this$retryer$continu = (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.continue()) != null ? _this$retryer$continu : this.execute();
|
|
1472
1474
|
}
|
|
1473
1475
|
|
|
1474
1476
|
async execute() {
|
|
@@ -1721,13 +1723,14 @@
|
|
|
1721
1723
|
}
|
|
1722
1724
|
|
|
1723
1725
|
resumePausedMutations() {
|
|
1724
|
-
|
|
1725
|
-
const pausedMutations = this.mutations.filter(x => x.state.isPaused);
|
|
1726
|
-
this.resuming = notifyManager.batch(() => pausedMutations.reduce((promise, mutation) => promise.then(() => mutation.continue().catch(noop$1)), Promise.resolve())).then(() => {
|
|
1727
|
-
this.resuming = undefined;
|
|
1728
|
-
});
|
|
1729
|
-
}
|
|
1726
|
+
var _this$resuming;
|
|
1730
1727
|
|
|
1728
|
+
this.resuming = ((_this$resuming = this.resuming) != null ? _this$resuming : Promise.resolve()).then(() => {
|
|
1729
|
+
const pausedMutations = this.mutations.filter(x => x.state.isPaused);
|
|
1730
|
+
return notifyManager.batch(() => pausedMutations.reduce((promise, mutation) => promise.then(() => mutation.continue().catch(noop$1)), Promise.resolve()));
|
|
1731
|
+
}).then(() => {
|
|
1732
|
+
this.resuming = undefined;
|
|
1733
|
+
});
|
|
1731
1734
|
return this.resuming;
|
|
1732
1735
|
}
|
|
1733
1736
|
|