MCPcopy Index your code
hub / github.com/material-shell/material-shell / addTimeout

Method addTimeout

src/utils/async.ts:8–18  ·  view source on GitHub ↗
(priority: number, interval: number, func: () => boolean)

Source from the content-addressed store, hash-verified

6 static timeoutIdList = [] as number[];
7
8 static addTimeout(priority: number, interval: number, func: () => boolean) {
9 const timeoutId = GLib.timeout_add(priority, interval, () => {
10 const source = func();
11 if (source == GLib.SOURCE_REMOVE) {
12 this.clearTimeoutId(timeoutId);
13 }
14 return source;
15 });
16 this.timeoutIdList.push(timeoutId);
17 return timeoutId;
18 }
19
20 static clearTimeoutId(timeoutId: number) {
21 if (timeoutId && this.timeoutIdList.includes(timeoutId)) {

Callers 11

loadMethod · 0.80
showSplashScreensMethod · 0.80
setTermsMethod · 0.80
throttleFunction · 0.80
scheduleMethod · 0.80
constructorMethod · 0.80
tooltipCallbackMethod · 0.80

Calls 2

clearTimeoutIdMethod · 0.95
pushMethod · 0.65

Tested by

no test coverage detected