Urara-Blog/node_modules/.pnpm-store/v3/files/f4/389515082993db308fc4c6b48d817b62cd067f803be75387d4b2e827cb9f5d67fb13c51b40c76881d1f03449d47ec9fab8e9bef39401951e045b155a59bc53
2022-08-14 01:14:53 +08:00

9 lines
402 B
Text

/*! 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))