Skip to content

Conversation

@Mimori256
Copy link
Contributor

This PR replaces Promise.resolve().then(){ with queueMicrotask()when scheduling thePerformanceObserver` callback.

This change makes the intention of microtask queuing clear and documents the Safari workaround, and also reduces the overhead of creating unnecessary promises.

queueMicrotask() is part of the Baseline widely available set, so this change should not introduce any new browser compatibility issues.

Replace `Promise.resolve().then()` with `queueMicrotask()` for more
explicit and efficient microtask scheduling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant