Open coolaj86 opened 2 years ago
Promise._sleep(n)
Proimse._map(arr, fn)
Proimse._parallel(n, arr, fn)
Another one of those things that just ought to be included.
As simple as it is, it's darn useful for:
/** * @param {Number} ms * @returns {Promise<void>} */ Promise._sleep = async function (ms) { return await new Promise(function (resolve) { setTimeout(resolve, ms); }); };
Promise._sleep(n)
Proimse._map(arr, fn)
Proimse._parallel(n, arr, fn)
Another one of those things that just ought to be included.
As simple as it is, it's darn useful for: