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

Function createThread

examples/ts-react-chat/src/routes/threads.tsx:193–201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

191 }
192
193 const createThread = (): ThreadMeta => {
194 const thread: ThreadMeta = {
195 id: crypto.randomUUID(),
196 title: NEW_CHAT_TITLE,
197 updatedAt: Date.now(),
198 }
199 commit([thread, ...threadsRef.current])
200 return thread
201 }
202
203 const deleteThread = (id: string) => {
204 threadPersistence.removeItem(id)

Callers 2

ThreadsRouteFunction · 0.85
handleNewChatFunction · 0.85

Calls 2

commitFunction · 0.85
nowMethod · 0.80

Tested by

no test coverage detected