Promise.delay() for ES6 and others. Returns a promise that will be resolved after a delay.
Install with npm
$ npm i promise-delay-plus --save
require('promise-delay-plus')();
or with any-promise
require('promise-delay-plus')(require('any-promise'));
Promise
.delay(1000,'hello')
.then(console.log);
// -> writes 'hello' after 1000ms
myAsyncFunction()
.delay(1000)
.then(console.log);
// -> writes the result of `myAsyncFunction` after a delay of 1000ms
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Andreas Pizsa
Copyright © 2016 Andreas Pizsa Released under the MIT license.
This file was generated by verb-cli on February 08, 2016.