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

Function createDataSearchTexts

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

Source from the content-addressed store, hash-verified

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

Callers 1

ContentViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected