MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / drainMacrotaskQueue

Function drainMacrotaskQueue

packages/core/utils/macrotask-scheduler.ts:7–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5let macroTaskQueue: Array<() => void> = [];
6
7function drainMacrotaskQueue() {
8 const currentQueue = macroTaskQueue;
9 macroTaskQueue = [];
10 scheduled = false;
11 currentQueue.forEach((task) => {
12 try {
13 task();
14 } catch (err) {
15 const msg = err ? err.stack || err : err;
16 Trace.write(`Error in macroTask: ${msg}`, Trace.categories.Error, Trace.messageType.error);
17 }
18 });
19}
20
21export function queueMacrotask(task: () => void): void {
22 macroTaskQueue.push(task);

Callers

nothing calls this directly

Calls 2

forEachMethod · 0.80
writeMethod · 0.65

Tested by

no test coverage detected