MCPcopy Create free account
hub / github.com/editablejs/editable / handleTypeaheadSearch

Function handleTypeaheadSearch

packages/ui/src/menu.tsx:237–246  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

235 const lastPointerXRef = React.useRef(0)
236
237 const handleTypeaheadSearch = (key: string) => {
238 const search = searchRef.current + key
239
240 // Reset `searchRef` 1 second after it was last updated
241 ;(function updateSearch(value: string) {
242 searchRef.current = value
243 window.clearTimeout(timerRef.current)
244 if (value !== '') timerRef.current = window.setTimeout(() => updateSearch(''), 1000)
245 })(search)
246 }
247
248 React.useEffect(() => {
249 return () => window.clearTimeout(timerRef.current)

Callers 1

menu.tsxFile · 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…