@creejs/commons-retrier 2.1.21 → 2.1.23

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.
@@ -1181,6 +1181,7 @@
1181
1181
  this._breakFlag.promise.finally(() => {
1182
1182
  this._breakFlag = undefined;
1183
1183
  this._breakReason = undefined;
1184
+ this._taskingFlag = undefined;
1184
1185
  });
1185
1186
  return this._breakFlag.promise
1186
1187
  }
@@ -1678,8 +1679,44 @@
1678
1679
  return retrier.start()
1679
1680
  }
1680
1681
 
1682
+ /**
1683
+ *
1684
+ * @param {Function} task
1685
+ * @returns {Retrier}
1686
+ */
1687
+ function retry (task) {
1688
+ const retrier = new Retrier();
1689
+ retrier.retry(task);
1690
+ return retrier
1691
+ }
1692
+
1693
+ /**
1694
+ *
1695
+ * @param {Function} task
1696
+ * @returns {Retrier}
1697
+ */
1698
+ function always (task) {
1699
+ const retrier = new Retrier();
1700
+ retrier.always(task);
1701
+ return retrier
1702
+ }
1703
+
1704
+ /**
1705
+ *
1706
+ * @param {Function} task
1707
+ * @returns {Retrier}
1708
+ */
1709
+ function forever (task) {
1710
+ const retrier = new Retrier();
1711
+ retrier.forever(task);
1712
+ return retrier
1713
+ }
1714
+
1681
1715
  // default export
1682
1716
  var RetrierFactory = {
1717
+ retry,
1718
+ always,
1719
+ forever,
1683
1720
  name,
1684
1721
  infinite,
1685
1722
  times,