MCPcopy
hub / github.com/sveltejs/svelte / run_tasks

Function run_tasks

packages/svelte/src/internal/client/loop.js:9–24  ·  view source on GitHub ↗

* @returns {void}

()

Source from the content-addressed store, hash-verified

7 * @returns {void}
8 */
9function run_tasks() {
10 // use `raf.now()` instead of the `requestAnimationFrame` callback argument, because
11 // otherwise things can get wonky https://github.com/sveltejs/svelte/pull/14541
12 const now = raf.now();
13
14 raf.tasks.forEach((task) => {
15 if (!task.c(now)) {
16 raf.tasks.delete(task);
17 task.f();
18 }
19 });
20
21 if (raf.tasks.size !== 0) {
22 raf.tick(run_tasks);
23 }
24}
25
26/**
27 * Creates a new task that runs on each raf frame

Callers

nothing calls this directly

Calls 2

forEachMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected