The microtask queue is useful for allowing the current browser task to finish while pushing some logic to happen immediately after that task (or next task).
- "click" event with non trivial, expensive logic. To allow the browser to finish that event, return sync control to that task while throwing the resulting logic in a
queueMicrotask
callback. - async rendering