Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jcoreio/async-throttle

Package Overview
Dependencies
Maintainers
13
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jcoreio/async-throttle - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

12

es/index.js

@@ -13,3 +13,8 @@ "use strict";

constructor(lastInvocationDone, wait) {
this.effect = new Promise(resolve => this.timeout = setTimeout(resolve, wait));
this.effect = new Promise((resolve, reject) => {
this.timeout = setTimeout(resolve, wait);
this.resolve = resolve;
this.reject = reject;
});
this.effect.catch(() => {});
this.ready = lastInvocationDone.then(() => this.effect);

@@ -20,3 +25,3 @@ }

clearTimeout(this.timeout);
this.effect = undefined;
this.resolve();
}

@@ -26,4 +31,3 @@

clearTimeout(this.timeout);
this.effect = Promise.reject(new CanceledError());
this.effect.catch(() => {});
this.reject(new CanceledError());
}

@@ -30,0 +34,0 @@

@@ -49,5 +49,8 @@ "use strict";

(0, _classCallCheck2["default"])(this, Delay);
this.effect = new Promise(function (resolve) {
return _this2.timeout = setTimeout(resolve, wait);
this.effect = new Promise(function (resolve, reject) {
_this2.timeout = setTimeout(resolve, wait);
_this2.resolve = resolve;
_this2.reject = reject;
});
this.effect["catch"](function () {});
this.ready = lastInvocationDone.then(function () {

@@ -62,3 +65,3 @@ return _this2.effect;

clearTimeout(this.timeout);
this.effect = undefined;
this.resolve();
}

@@ -69,4 +72,3 @@ }, {

clearTimeout(this.timeout);
this.effect = Promise.reject(new CanceledError());
this.effect["catch"](function () {});
this.reject(new CanceledError());
}

@@ -73,0 +75,0 @@ }]);

{
"name": "@jcoreio/async-throttle",
"version": "1.4.0",
"version": "1.4.1",
"description": "throttle async and promise-returning functions. Other packages don't do it right.",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc