MCPcopy
hub / github.com/TanStack/query / chatAnswer

Function chatAnswer

examples/react/chat/src/chat.ts:11–24  ·  view source on GitHub ↗
(_question: string)

Source from the content-addressed store, hash-verified

9]
10
11function chatAnswer(_question: string) {
12 return {
13 async *[Symbol.asyncIterator]() {
14 const answer = answers[Math.floor(Math.random() * answers.length)]
15 let index = 0
16 while (index < answer.length) {
17 await new Promise((resolve) =>
18 setTimeout(resolve, 100 + Math.random() * 300),
19 )
20 yield answer[index++]
21 }
22 },
23 }
24}
25
26export const chatQueryOptions = (question: string) =>
27 queryOptions({

Callers 1

chatQueryOptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…