@tanstack/vue-query 4.24.4 → 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.
@@ -581,9 +581,13 @@
581
581
  const pause = () => {
582
582
  return new Promise(continueResolve => {
583
583
  continueFn = value => {
584
- if (isResolved || !shouldPause()) {
585
- return continueResolve(value);
584
+ const canContinue = isResolved || !shouldPause();
585
+
586
+ if (canContinue) {
587
+ continueResolve(value);
586
588
  }
589
+
590
+ return canContinue;
587
591
  };
588
592
 
589
593
  config.onPause == null ? void 0 : config.onPause();
@@ -663,7 +667,8 @@
663
667
  promise,
664
668
  cancel,
665
669
  continue: () => {
666
- continueFn == null ? void 0 : continueFn();
670
+ const didContinue = continueFn == null ? void 0 : continueFn();
671
+ return didContinue ? promise : Promise.resolve();
667
672
  },
668
673
  cancelRetry,
669
674
  continueRetry
@@ -1439,12 +1444,9 @@
1439
1444
  }
1440
1445
 
1441
1446
  continue() {
1442
- if (this.retryer) {
1443
- this.retryer.continue();
1444
- return this.retryer.promise;
1445
- }
1447
+ var _this$retryer$continu, _this$retryer;
1446
1448
 
1447
- return this.execute();
1449
+ return (_this$retryer$continu = (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.continue()) != null ? _this$retryer$continu : this.execute();
1448
1450
  }
1449
1451
 
1450
1452
  async execute() {
@@ -1697,8 +1699,15 @@
1697
1699
  }
1698
1700
 
1699
1701
  resumePausedMutations() {
1700
- const pausedMutations = this.mutations.filter(x => x.state.isPaused);
1701
- return notifyManager.batch(() => pausedMutations.reduce((promise, mutation) => promise.then(() => mutation.continue().catch(noop)), Promise.resolve()));
1702
+ var _this$resuming;
1703
+
1704
+ this.resuming = ((_this$resuming = this.resuming) != null ? _this$resuming : Promise.resolve()).then(() => {
1705
+ const pausedMutations = this.mutations.filter(x => x.state.isPaused);
1706
+ return notifyManager.batch(() => pausedMutations.reduce((promise, mutation) => promise.then(() => mutation.continue().catch(noop)), Promise.resolve()));
1707
+ }).then(() => {
1708
+ this.resuming = undefined;
1709
+ });
1710
+ return this.resuming;
1702
1711
  }
1703
1712
 
1704
1713
  }