Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xotic750/delay-promise-x
Create a delayed promise.
https://github.com/xotic750/delay-promise-x
delay promise
Last synced: about 2 months ago
JSON representation
Create a delayed promise.
- Host: GitHub
- URL: https://github.com/xotic750/delay-promise-x
- Owner: Xotic750
- License: mit
- Created: 2018-11-25T01:40:56.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T21:40:41.000Z (almost 2 years ago)
- Last Synced: 2024-11-13T07:58:10.488Z (about 2 months ago)
- Topics: delay, promise
- Language: JavaScript
- Size: 3.44 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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 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') ;
});
``