1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-31 04:59:50 +02:00

Make API call on 3 or more characters

This commit is contained in:
Kamran Ahmed
2024-04-12 00:03:14 +01:00
parent c4c7499a22
commit c2a5e5a805

View File

@@ -69,6 +69,10 @@ export function AITermSuggestionInput(props: AITermSuggestionInputProps) {
return [];
}
if (trimmedValue.length < 3) {
return [];
}
if (termCache.has(trimmedValue)) {
const cachedData = termCache.get(trimmedValue);
return cachedData || [];