Skip to content

Replace setTimeout with queueMicrotask where possible #1880

@TrevorBurnham

Description

@TrevorBurnham

There are a few places where setTimeout is used for an arbitrarily short delay. These could be converted to queueMicrotask to reduce idle time.

In the case of the setTimeout in MutationObserverListener, this change would also make the behavior more consistent with the DOM spec, which states that mutation observer callbacks are executed as microtasks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions