github-wc-polyfill icon indicating copy to clipboard operation
github-wc-polyfill copied to clipboard

Faster queueMicrotask?

Open FrozenVoid opened this issue 5 years ago • 0 comments

Current implementation use setTimeouts, there is a faster version from MDN

 `typeof queueMicrotask !== 'function' && (queueMicrotask = function (callback) {
    Promise.resolve()
      .then(callback)        }
                    )`

https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask Its also possible to implement 0ms setTimeout via https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage

FrozenVoid avatar Jan 06 '21 19:01 FrozenVoid