@peersyst/react-utils
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -16,3 +16,3 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
_classCallCheck(this, TimeoutPromiseError); | ||
return _super.call(this, "Promise timed out"); | ||
return _super.call(this, "Promise timeout"); | ||
} | ||
@@ -26,3 +26,3 @@ return _createClass(TimeoutPromiseError); | ||
_timeoutPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(promise, ms) { | ||
var timeout, res; | ||
var timeout, rejectedPromise, res; | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
@@ -32,7 +32,9 @@ while (1) { | ||
case 0: | ||
timeout = setTimeout(function () { | ||
Promise.reject(new TimeoutPromiseError()); | ||
}, ms); | ||
rejectedPromise = new Promise(function (_, reject) { | ||
timeout = setTimeout(function () { | ||
reject(new TimeoutPromiseError()); | ||
}, ms); | ||
}); | ||
_context.next = 3; | ||
return promise; | ||
return Promise.race([promise, rejectedPromise]); | ||
case 3: | ||
@@ -39,0 +41,0 @@ res = _context.sent; |
@@ -16,3 +16,3 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
_classCallCheck(this, TimeoutPromiseError); | ||
return _super.call(this, "Promise timed out"); | ||
return _super.call(this, "Promise timeout"); | ||
} | ||
@@ -26,3 +26,3 @@ return _createClass(TimeoutPromiseError); | ||
_timeoutPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(promise, ms) { | ||
var timeout, res; | ||
var timeout, rejectedPromise, res; | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
@@ -32,7 +32,9 @@ while (1) { | ||
case 0: | ||
timeout = setTimeout(function () { | ||
Promise.reject(new TimeoutPromiseError()); | ||
}, ms); | ||
rejectedPromise = new Promise(function (_, reject) { | ||
timeout = setTimeout(function () { | ||
reject(new TimeoutPromiseError()); | ||
}, ms); | ||
}); | ||
_context.next = 3; | ||
return promise; | ||
return Promise.race([promise, rejectedPromise]); | ||
case 3: | ||
@@ -39,0 +41,0 @@ res = _context.sent; |
@@ -16,3 +16,3 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
_classCallCheck(this, TimeoutPromiseError); | ||
return _super.call(this, "Promise timed out"); | ||
return _super.call(this, "Promise timeout"); | ||
} | ||
@@ -26,3 +26,3 @@ return _createClass(TimeoutPromiseError); | ||
_timeoutPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(promise, ms) { | ||
var timeout, res; | ||
var timeout, rejectedPromise, res; | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
@@ -32,7 +32,9 @@ while (1) { | ||
case 0: | ||
timeout = setTimeout(function () { | ||
Promise.reject(new TimeoutPromiseError()); | ||
}, ms); | ||
rejectedPromise = new Promise(function (_, reject) { | ||
timeout = setTimeout(function () { | ||
reject(new TimeoutPromiseError()); | ||
}, ms); | ||
}); | ||
_context.next = 3; | ||
return promise; | ||
return Promise.race([promise, rejectedPromise]); | ||
case 3: | ||
@@ -39,0 +41,0 @@ res = _context.sent; |
@@ -24,3 +24,3 @@ "use strict"; | ||
(0, _classCallCheck2["default"])(this, TimeoutPromiseError); | ||
return _super.call(this, "Promise timed out"); | ||
return _super.call(this, "Promise timeout"); | ||
} | ||
@@ -35,3 +35,3 @@ return (0, _createClass2["default"])(TimeoutPromiseError); | ||
_timeoutPromise = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(promise, ms) { | ||
var timeout, res; | ||
var timeout, rejectedPromise, res; | ||
return _regenerator["default"].wrap(function _callee$(_context) { | ||
@@ -41,7 +41,9 @@ while (1) { | ||
case 0: | ||
timeout = setTimeout(function () { | ||
Promise.reject(new TimeoutPromiseError()); | ||
}, ms); | ||
rejectedPromise = new Promise(function (_, reject) { | ||
timeout = setTimeout(function () { | ||
reject(new TimeoutPromiseError()); | ||
}, ms); | ||
}); | ||
_context.next = 3; | ||
return promise; | ||
return Promise.race([promise, rejectedPromise]); | ||
case 3: | ||
@@ -48,0 +50,0 @@ res = _context.sent; |
{ | ||
"name": "@peersyst/react-utils", | ||
"author": "Peersyst", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "main": "./node/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
176049
3666