UNPKG

251 BJavaScriptView Raw
1/*
2 * waits for `ms` milliseconds and resolves a promise.
3 */
4
5module.exports = function wait (ms) {
6 return function () {
7 return new Promise(function (resolve, reject) {
8 setTimeout(function () {
9 resolve()
10 }, ms)
11 })
12 }
13}