Search
Detail
<DendronSearch {...props} />
- components/DendronSearch.tsx
DebouncedDendronSearchComponent {
debouncedSearch = debounce(..., SEARCH_DELAY)
return DendronSearchComponent search=debouncedSearch
}
DendronSearchComponent(props) {
search : = props
value, search = useState(initValue)
{ noteBodies, requestNotes } = useNoteBodies();
useEffect {
search ? search(value, setSearchResults)
}, [value, search]
useEffect {
requestNotes(searchResults)
}, [searchResults]
useEffect {
value.startsWith "?" {
setResults
}
}
AutoComplete {
results.map {
AutoComplete {
MatchBody {
}
}
}
}
}
MatchBody {
}
useNoteBodies {
fetchNoteBodyWithId(id) {
fetch /data/notes/${id}.md
}
}
Fuse
useFuse {
value = await provider
if (value) {
}
}