MCPcopy Create free account
hub / github.com/TanStack/query / createDataSearchTexts

Function createDataSearchTexts

packages/query-devtools/src/Devtools.tsx:146–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144 * which returns whether the search texts of all the data are built.
145 */
146const createDataSearchTexts = () => {
147 const [version, setVersion] = createSignal(0)
148 let timeout: ReturnType<typeof setTimeout> | undefined
149 onCleanup(() => clearTimeout(timeout))
150
151 const prepare = (data: Array<unknown>) => {
152 clearTimeout(timeout)
153 const deadline = performance.now() + 8
154 if (data.every((item) => getDataSearchText(item, deadline) !== undefined)) {
155 return true
156 }
157 timeout = setTimeout(() => setVersion((current) => current + 1))
158 return false
159 }
160
161 return { version, prepare }
162}
163
164interface DevtoolsPanelProps {
165 localStore: StorageObject<string>

Callers 1

ContentViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected