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

Function readIndex

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

Source from the content-addressed store, hash-verified

122}
123
124function readIndex(): Array<ThreadMeta> {
125 if (!hasWindow()) return []
126 try {
127 const raw = window.localStorage.getItem(INDEX_KEY)
128 return raw ? (JSON.parse(raw) as Array<ThreadMeta>) : []
129 } catch {
130 return []
131 }
132}
133
134function writeIndex(threads: Array<ThreadMeta>): void {
135 if (!hasWindow()) return

Callers 1

useThreadIndexFunction · 0.85

Calls 2

hasWindowFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected