• File: index.js
  • Full Path: /var/www/paytek-africa.com/node_modules/queue-microtask/index.js
  • Date Modified: 07/19/2022 5:05 PM
  • File size: 402 bytes
  • MIME-type: text/plain
  • Charset: utf-8
/*! 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))