global.queueMicrotask
Runs callback in the microtask queue, before the next task.
Usage
Defer a small follow-up until the current synchronous work finishes.
// Defer a small follow-up until the current synchronous work finishes.
const events: string[] = [];
queueMicrotask(() => console.log(events.join(', ')));
events.push('saved');
events.push('closed');Signatures
(callback: () => void): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
callback | () => void | Yes | — |
Returns
void
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.