UNPKG

rx-player

Version:
18 lines (17 loc) 425 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = sleep; /** * Convert a setTimeout to a Promise. * * You can use it to have a much more readable blocking code with async/await * in some asynchronous tests. * * @param {number} timeInMs * @returns {Promise} */ function sleep(timeInMs) { return new Promise(function (res) { setTimeout(res, timeInMs); }); }