Comparing version 2.2.2 to 2.3.0
@@ -21,2 +21,11 @@ export interface Limit { | ||
readonly pendingCount: number; | ||
/** | ||
Discard pending promises that are waiting to run. | ||
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. | ||
Note: This does not cancel promises that are already running. | ||
*/ | ||
clearQueue(): void; | ||
} | ||
@@ -23,0 +32,0 @@ |
@@ -45,2 +45,7 @@ 'use strict'; | ||
get: () => queue.length | ||
}, | ||
clearQueue: { | ||
value: () => { | ||
queue.length = 0; | ||
} | ||
} | ||
@@ -47,0 +52,0 @@ }); |
{ | ||
"name": "p-limit", | ||
"version": "2.2.2", | ||
"version": "2.3.0", | ||
"description": "Run multiple promise-returning & async functions with limited concurrency", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -69,2 +69,10 @@ # p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) | ||
### limit.clearQueue() | ||
Discard pending promises that are waiting to run. | ||
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. | ||
Note: This does not cancel promises that are already running. | ||
## FAQ | ||
@@ -71,0 +79,0 @@ |
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
7390
76
102