👁 查看:index.js
路径:/home/boguraj1/public_html/jobsite/node_modules/queue-microtask/index.js
大小:402 B · 修改:2022-11-21 20:11:00 · 权限:0644 · 可写
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
let promise

module.exports = typeof queueMicrotask === 'function'
  ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global)
  // reuse resolved promise, and allocate it lazily
  : cb => (promise || (promise = Promise.resolve()))
    .then(cb)
    .catch(err => setTimeout(() => { throw err }, 0))