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.
@@ -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 };
@@ -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, 100);
22
+ const debouncedValue = useDebounce(search, delayMs);
23
23
  const query = useSWR(
24
24
  [api, debouncedValue, locale, tag],
25
25
  (args) => fetchDocs(...args),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "12.3.0",
3
+ "version": "12.3.1",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",