pdp

promise-delay-plus

Promise.delay() for ES6. Returns a promise that will be resolved after a delay.

Showing:

Popularity

Downloads/wk

1

GitHub Stars

1

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

promise-delay-plus Travis Coverage Status Downloads

Promise.delay() for ES6 and others. Returns a promise that will be resolved after a delay.

Install

Install with npm

$ npm i promise-delay-plus --save

Usage

require('promise-delay-plus')();

or with any-promise

require('promise-delay-plus')(require('any-promise'));

API

Promise.delay(ms[,value])

Promise
  .delay(1000,'hello')
  .then(console.log);
// -> writes 'hello' after 1000ms

promise.delay(ms)

myAsyncFunction()
  .delay(1000)
  .then(console.log);
// -> writes the result of `myAsyncFunction` after a delay of 1000ms 

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Andreas Pizsa

License

Copyright © 2016 Andreas Pizsa Released under the MIT license.


This file was generated by verb-cli on February 08, 2016.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100