global: snapshot

This commit is contained in:
nym21
2026-02-13 16:54:09 +01:00
parent d18c872072
commit dfcb04484b
17 changed files with 485 additions and 265 deletions

View File

@@ -11,6 +11,15 @@ export function next() {
return sleep(0);
}
/**
* @param {() => void} callback
*/
export function idle(callback) {
("requestIdleCallback" in window ? requestIdleCallback : setTimeout)(
callback,
);
}
/**
*
* @template {(...args: any[]) => any} F