@dreamtree-org/twreact-ui 1.0.68 → 1.0.69
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/dist/index.esm.js +24 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +24 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20459,59 +20459,64 @@ var Helpers = /*#__PURE__*/function () {
|
|
|
20459
20459
|
}
|
|
20460
20460
|
}]);
|
|
20461
20461
|
}();
|
|
20462
|
+
|
|
20463
|
+
// A serializable-safe TrackingPromise that *does not* put the promise or any methods in the redux action payload.
|
|
20464
|
+
// This class is only intended to be used locally (not as part of redux/store payloads).
|
|
20465
|
+
// DO NOT EVER put an instance of TrackingPromise directly in redux actions.
|
|
20462
20466
|
var TrackingPromise = /*#__PURE__*/function () {
|
|
20463
20467
|
function TrackingPromise(callback) {
|
|
20464
20468
|
var _this = this;
|
|
20465
20469
|
_classCallCheck$1(this, TrackingPromise);
|
|
20466
|
-
|
|
20467
|
-
|
|
20468
|
-
|
|
20469
|
-
|
|
20470
|
-
|
|
20471
|
-
|
|
20472
|
-
|
|
20473
|
-
|
|
20474
|
-
|
|
20470
|
+
this._state = "pending";
|
|
20471
|
+
this._callback = callback;
|
|
20472
|
+
this._promise = new Promise(function (resolve, reject) {
|
|
20473
|
+
_this._resolve = function (value) {
|
|
20474
|
+
_this._state = "fulfilled";
|
|
20475
|
+
resolve(value);
|
|
20476
|
+
};
|
|
20477
|
+
_this._reject = function (reason) {
|
|
20478
|
+
_this._state = "rejected";
|
|
20479
|
+
reject(reason);
|
|
20475
20480
|
};
|
|
20476
|
-
_this.
|
|
20481
|
+
_this._callback(_this._resolve, _this._reject);
|
|
20477
20482
|
});
|
|
20478
20483
|
}
|
|
20479
20484
|
return _createClass$1(TrackingPromise, [{
|
|
20480
20485
|
key: "resolve",
|
|
20481
20486
|
value: function resolve(value) {
|
|
20482
|
-
this.
|
|
20483
|
-
this.
|
|
20487
|
+
if (this._state !== "pending") return;
|
|
20488
|
+
this._resolve(value);
|
|
20484
20489
|
}
|
|
20485
20490
|
}, {
|
|
20486
20491
|
key: "reject",
|
|
20487
20492
|
value: function reject(reason) {
|
|
20488
|
-
this.
|
|
20489
|
-
this.
|
|
20493
|
+
if (this._state !== "pending") return;
|
|
20494
|
+
this._reject(reason);
|
|
20490
20495
|
}
|
|
20491
20496
|
}, {
|
|
20492
20497
|
key: "isFulfilled",
|
|
20493
20498
|
value: function isFulfilled() {
|
|
20494
|
-
return this.
|
|
20499
|
+
return this._state === "fulfilled";
|
|
20495
20500
|
}
|
|
20496
20501
|
}, {
|
|
20497
20502
|
key: "isRejected",
|
|
20498
20503
|
value: function isRejected() {
|
|
20499
|
-
return this.
|
|
20504
|
+
return this._state === "rejected";
|
|
20500
20505
|
}
|
|
20501
20506
|
}, {
|
|
20502
20507
|
key: "isPending",
|
|
20503
20508
|
value: function isPending() {
|
|
20504
|
-
return this.
|
|
20509
|
+
return this._state === "pending";
|
|
20505
20510
|
}
|
|
20506
20511
|
}, {
|
|
20507
20512
|
key: "then",
|
|
20508
20513
|
value: function then(onFulfilled, onRejected) {
|
|
20509
|
-
return this.
|
|
20514
|
+
return this._promise.then(onFulfilled, onRejected);
|
|
20510
20515
|
}
|
|
20511
20516
|
}, {
|
|
20512
20517
|
key: "catch",
|
|
20513
20518
|
value: function _catch(onRejected) {
|
|
20514
|
-
return this.
|
|
20519
|
+
return this._promise["catch"](onRejected);
|
|
20515
20520
|
}
|
|
20516
20521
|
}]);
|
|
20517
20522
|
}();
|