Skip to content

Releases: sindresorhus/p-throttle

v6.2.0

14 Aug 14:23
Compare
Choose a tag to compare
  • Pass the given call arguments to onDelay (#56) 7332e6e

v6.1.0...v6.2.0

v6.1.0

07 Dec 11:56
Compare
Choose a tag to compare

v6.0.0...v6.1.0

v6.0.0

17 Nov 19:35
Compare
Choose a tag to compare

Breaking

Fixes

  • Fix handling of generic functions in the types 329a240
  • Fix timeout overflow with {strict: true} with many long delays a1b3d77

v5.1.0...v6.0.0

v5.1.0

12 May 05:47
Compare
Choose a tag to compare
  • Add property to get the queue size (#39) 3e7a732

v5.0.0...v5.1.0

v5.0.0

04 Oct 16:35
Compare
Choose a tag to compare

Breaking

v4.1.1...v5.0.0

v4.1.1

26 Feb 14:21
Compare
Choose a tag to compare

v4.1.0

21 Feb 14:17
Compare
Choose a tag to compare

v4.0.0...v4.1.0

v4.0.0

19 Jan 09:14
Compare
Choose a tag to compare

Breaking

  • Require Node.js 10 (#22) 5cb0a4e
  • Currify function and move arguments to an optons-object (#22) 5cb0a4e
 const pThrottle = require('p-throttle');

 const now = Date.now();

-const throttled = pThrottle(index => {
+const throttled = pThrottle({limit: 2, interval: 1000})(index => {
 	const secDiff = ((Date.now() - now) / 1000).toFixed();
 	return Promise.resolve(`${index}: ${secDiff}s`);
-}, 2, 1000);
+);

 for (let i = 1; i <= 6; i++) {
 	throttled(i).then(console.log);
 }

This has the benefit that it allows reusing the throttled instance. See: #16

v3.1.0...v4.0.0

v3.1.0

06 Apr 15:29
Compare
Choose a tag to compare
  • Refactor TypeScript definition to CommonJS compatible export (#17) b734458

v3.0.0...v3.1.0

v3.0.0

20 Feb 05:15
Compare
Choose a tag to compare

Breaking:

It's only breaking for TypeScript users. If you don't use TypeScript, nothing has changed.

v2.1.1...v3.0.0