MCPcopy Create free account
hub / github.com/TanStack/ai / createDeferred

Function createDeferred

packages/ai-client/tests/chat-client.test.ts:44–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42 }
43
44 function createDeferred<T>() {
45 let resolve!: (value: T) => void
46 let reject!: (reason?: unknown) => void
47 const promise = new Promise<T>((promiseResolve, promiseReject) => {
48 resolve = promiseResolve
49 reject = promiseReject
50 })
51 return { promise, resolve, reject }
52 }
53
54 describe('constructor', () => {
55 it('should create a client with default options', () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected