fumadocs-core 12.3.0 → 12.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/search/client.d.ts +2 -1
- package/dist/search/client.js +2 -2
- package/package.json +1 -1
package/dist/search/client.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ interface UseDocsSearch {
|
|
|
12
12
|
* @param locale - Filter with locale
|
|
13
13
|
* @param tag - Filter with specific tag
|
|
14
14
|
* @param api - The Search API URL
|
|
15
|
+
* @param delayMs - The debounced delay for performing a search.
|
|
15
16
|
*/
|
|
16
|
-
declare function useDocsSearch(locale?: string, tag?: string, api?: string): UseDocsSearch;
|
|
17
|
+
declare function useDocsSearch(locale?: string, tag?: string, api?: string, delayMs?: number): UseDocsSearch;
|
|
17
18
|
|
|
18
19
|
export { useDocsSearch };
|
package/dist/search/client.js
CHANGED
|
@@ -17,9 +17,9 @@ function fetchDocs(api, query, locale, tag) {
|
|
|
17
17
|
return yield res.json();
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
function useDocsSearch(locale, tag, api = "/api/search") {
|
|
20
|
+
function useDocsSearch(locale, tag, api = "/api/search", delayMs = 100) {
|
|
21
21
|
const [search, setSearch] = useState("");
|
|
22
|
-
const debouncedValue = useDebounce(search,
|
|
22
|
+
const debouncedValue = useDebounce(search, delayMs);
|
|
23
23
|
const query = useSWR(
|
|
24
24
|
[api, debouncedValue, locale, tag],
|
|
25
25
|
(args) => fetchDocs(...args),
|