選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

10 行
402 B

  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))