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

Function loop

packages/svelte/src/internal/client/loop.js:32–48  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

30 * @returns {Task}
31 */
32export function loop(callback) {
33 /** @type {TaskEntry} */
34 let task;
35
36 if (raf.tasks.size === 0) {
37 raf.tick(run_tasks);
38 }
39
40 return {
41 promise: new Promise((fulfill) => {
42 raf.tasks.add((task = { c: callback, f: fulfill }));
43 }),
44 abort() {
45 raf.tasks.delete(task);
46 }
47 };
48}

Callers 5

setFunction · 0.90
#updateMethod · 0.90
setFunction · 0.90
setMethod · 0.90
animateFunction · 0.90

Calls 1

addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…