simple-delay

Create a promise that resolves after a certain amount of time

Usage no npm install needed!

<script type="module">
  import simpleDelay from 'https://cdn.skypack.dev/simple-delay';
</script>

README

Simple Delay

Create a promise that resolves after a certain amount of time

Usages

Basic

import delay from 'simple-delay'
delay(5000).then(() => console.log('5 seconds have passed'))

Supply your own setTimeout

import { callSetTimeout } from 'simple-delay'
const mySetTimeout = setTimeout
callSetTimeout(mySetTimeout, 5000).then(() => console.log('5 seconds have passed'))

License

MIT © Hoàng Văn Khải