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

Function deferred

nodejs/test/e2e/client_lifecycle.e2e.test.ts:12–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10 const { copilotClient: client } = await createSdkTestContext();
11
12 function deferred<T>(): { promise: Promise<T>; resolve: (value: T) => void } {
13 let resolveFn!: (value: T) => void;
14 const promise = new Promise<T>((resolve) => {
15 resolveFn = resolve;
16 });
17 return { promise, resolve: resolveFn };
18 }
19
20 async function withTimeout<T>(promise: Promise<T>, ms: number, label: string): Promise<T> {
21 let timer: NodeJS.Timeout | undefined;

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…