Documentation - v7.17.0
    Preparing search index...

    Function queueMicrotask

    • Schedules callback to run as a microtask, using the native queueMicrotask when available and falling back to Promise.resolve().then(callback) otherwise.

      The native implementation is looked up on globalObject at call-time to support environments where the global object changes after module initialisation (e.g. Selenium GeckoDriver's executeScript). Binding it early with .bind(globalObject) throws "queueMicrotask called on an object that does not implement interface Window" in those environments; calling it as an unbound method avoids the issue. See https://github.com/mozilla/geckodriver/issues/1798

      Parameters

      • callback: () => void

        The function to schedule as a microtask.

      Returns void