The standard Deno module for delaying a specified amount of time.
import { delay } from 'https://deno.land/x/delay@v0.2.0/mod.ts';
import { delay } from 'https://deno.land/x/delay@v0.2.0/mod.ts';
(async () => {
console.log('Executed 100 milliseconds later');
await delay(100);
console.log('Hello World!');
})();
import { delay } from 'https://deno.land/x/delay@v0.2.0/mod.ts';
(async () => {
try {
await delay.reject(100, { value: new Error('Rejected') });
console.log('This is never executed');
} catch (error) {
// 100 milliseconds later
console.log(error);
//=> [Error: Rejected]
}
})();
Details changes for each release are documented in the CHANGELOG.md.
If you think any of the delay
can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.
We'd love to have your helping hand on contributions to delay
by forking and sending a pull request!
Your contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)
How to contribute:
- Open pull request with improvements
- Discuss ideas in issues
- Spread the word
- Reach out with any feedback