MCPcopy Create free account
hub / github.com/Open-Dev-Society/OpenStock / handleSearch

Function handleSearch

components/SearchCommand.tsx:31–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 }, [])
30
31 const handleSearch = async () => {
32 if(!isSearchMode) return setStocks(initialStocks);
33
34 setLoading(true)
35 try {
36 const results = await searchStocks(searchTerm.trim());
37 setStocks(results);
38 } catch {
39 setStocks([])
40 } finally {
41 setLoading(false)
42 }
43 }
44
45 const debouncedSearch = useDebounce(handleSearch, 300);
46

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected