Options
All
  • Public
  • Public/Protected
  • All
Menu

simple-delay — Reference

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

Generated using TypeDoc