MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / deferred

Function deferred

src/pkg/utils/utils.ts:32–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30};
31
32export const deferred = <T = void>(): Deferred<T> => {
33 let resolve!: (v: T | PromiseLike<T>) => void;
34 let reject!: (e?: any) => void;
35 const promise = new Promise<T>((res, rej) => {
36 resolve = res;
37 reject = rej;
38 });
39 return { promise, resolve, reject };
40};
41
42export function isFirefox() {
43 // @ts-ignore. For both Page & Worker

Callers 4

setupBlockingTaskFunction · 0.90
index.tsFile · 0.90
nextSessionRuleIdFunction · 0.90

Calls

no outgoing calls

Tested by 1

setupBlockingTaskFunction · 0.72