Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
October 9, 2021 03:44 pm GMT

Promisify setTimeout

Code to promisify setTimeout

const delay = (time) => new Promise((resolve, reject) => setTimeout(resolve, time))

Usage

delay(2000).then(() => console.log('Hello i will get logged after 2 second(s)'))

Original Link: https://dev.to/sakethkowtha/promisify-settimeout-2knn

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To