Search optimization
This commit is contained in:
parent
daabaa3bd3
commit
558e756b53
@ -126,6 +126,11 @@ export async function search(arn: AnimeNotifier, search: HTMLInputElement, evt?:
|
|||||||
.catch(console.error)
|
.catch(console.error)
|
||||||
|
|
||||||
requestIdleCallback(() => {
|
requestIdleCallback(() => {
|
||||||
|
// Check that the term hasn't changed in the meantime
|
||||||
|
if(term !== search.value.trim()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
fetch("/_/character-search/" + term, fetchOptions)
|
fetch("/_/character-search/" + term, fetchOptions)
|
||||||
.then(showResponseInElement(arn, url, "character", characterSearchResults))
|
.then(showResponseInElement(arn, url, "character", characterSearchResults))
|
||||||
.catch(console.error)
|
.catch(console.error)
|
||||||
|
Loading…
Reference in New Issue
Block a user