Awesome Open Source
Awesome Open Source

await-delay

use delay/sleep to async/await ES7

Installation

npm i --save await-delay

Usage

import delay from 'await-delay'

async () => {
  // Do something
  
  // Wait for 2 seconds 
  await delay(2000)

  // Do things after the delay
}


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,555,308
Promise (1,432
Async Await (591
Es7 (294
Sleep (200
Delay (168
Related Projects