You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789
  1. /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  2. let promise
  3. module.exports = typeof queueMicrotask === 'function'
  4. ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global)
  5. // reuse resolved promise, and allocate it lazily
  6. : cb => (promise || (promise = Promise.resolve()))
  7. .then(cb)
  8. .catch(err => setTimeout(() => { throw err }, 0))