UNPKG

chrome-remote-interface-extra

Version:

Bringing a puppeteer like API and more to the chrome-remote-interface by cyrus-and

18 lines (15 loc) 296 B
class TaskQueue { constructor () { this._chain = Promise.resolve() } /** * @param {Function} task * @return {Promise} */ postTask (task) { const result = this._chain.then(task) this._chain = result.catch(() => {}) return result } } module.exports = TaskQueue