delay-promise-x

1.1.2 • Public • Published

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

delay-promise-x

Returns a promise that will be resolved with value (or undefined) after given ms milliseconds. If value is a promise, the delay will start counting down when it is fulfilled and the returned promise will be fulfilled with the fulfillment value of the value promise.

delayPromise(
    int ms,
    [any|Promise<any> value=undefined]
) -> Promise

Basic examples

delayPromise(500).then(function() {
    console.log('500 ms passed');
    return delayPromise(500, 'Hello world');
}).then(function(helloWorldString) {
    console.log(helloWorldString);
    console.log('another 500 ms passed') ;
});
``

Readme

Keywords

Package Sidebar

Install

npm i delay-promise-x

Weekly Downloads

520

Version

1.1.2

License

MIT

Unpacked Size

784 kB

Total Files

11

Last publish

Collaborators

  • xotic750