p-min-delay
Advanced tools
Comparing version 4.0.1 to 4.0.2
import delay from 'yoctodelay'; | ||
export default async function pMinDelay(promise, minimumDelay, {delayRejection = true} = {}) { | ||
await Promise[delayRejection ? 'allSettled' : 'all']([ | ||
promise, | ||
delay(minimumDelay) | ||
]); | ||
const delayPromise = delay(minimumDelay); | ||
await (delayRejection ? delayPromise : Promise.all([promise, delayPromise])); | ||
return promise; | ||
} |
{ | ||
"name": "p-min-delay", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Delay a promise a minimum amount of time", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -11,5 +11,5 @@ # p-min-delay | ||
```sh | ||
npm install p-min-delay | ||
``` | ||
$ npm install p-min-delay | ||
``` | ||
@@ -16,0 +16,0 @@ ## Usage |
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
4481
30