p-throttle
Advanced tools
Comparing version 5.0.0 to 5.1.0
@@ -13,11 +13,16 @@ export class AbortError extends Error { | ||
/** | ||
Whether future function calls should be throttled or count towards throttling thresholds. | ||
Whether future function calls should be throttled or count towards throttling thresholds. | ||
@default true | ||
*/ | ||
@default true | ||
*/ | ||
isEnabled: boolean; | ||
/** | ||
Abort pending executions. All unresolved promises are rejected with a `pThrottle.AbortError` error. | ||
*/ | ||
The number of queued items waiting to be executed. | ||
*/ | ||
readonly queueSize: number; | ||
/** | ||
Abort pending executions. All unresolved promises are rejected with a `pThrottle.AbortError` error. | ||
*/ | ||
abort(): void; | ||
@@ -24,0 +29,0 @@ }; |
@@ -95,4 +95,10 @@ export class AbortError extends Error { | ||
Object.defineProperty(throttled, 'queueSize', { | ||
get() { | ||
return queue.size; | ||
}, | ||
}); | ||
return throttled; | ||
}; | ||
} |
{ | ||
"name": "p-throttle", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "Throttle promise-returning & async functions", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -99,2 +99,8 @@ # p-throttle | ||
### throttledFn.queueSize | ||
Type: `number` | ||
The number of queued items waiting to be executed. | ||
## Related | ||
@@ -101,0 +107,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
8698
147
111