MCPcopy Create free account
hub / github.com/github/copilot-sdk / deferred

Function deferred

nodejs/test/e2e/suspend.e2e.test.ts:20–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18};
19
20function deferred<T>(): Deferred<T> {
21 let resolveFn!: (value: T) => void;
22 let isSettled = false;
23 const promise = new Promise<T>((resolve) => {
24 resolveFn = (value: T) => {
25 isSettled = true;
26 resolve(value);
27 };
28 });
29 return { promise, resolve: resolveFn, settled: () => isSettled };
30}
31
32async function waitWithTimeout<T>(
33 promise: Promise<T>,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…