1
0
mirror of https://gitlab.com/MisterBiggs/brain-quartz.git synced 2025-07-22 22:31:26 +00:00

docs: add documentation for Operand Search, remove debounce

This commit is contained in:
Jacky Zhao
2022-07-31 18:02:06 -07:00
parent 23380d0519
commit b10b23a47b
6 changed files with 63 additions and 21 deletions

View File

@@ -15,15 +15,7 @@ async function searchContents(query) {
return (await response.json());
}
function debounce(func, timeout = 300) {
let timer;
return (...args) => {
clearTimeout(timer)
timer = setTimeout(() => { func.apply(this, args); }, timeout)
};
}
registerHandlers(debounce((e) => {
registerHandlers((e) => {
term = e.target.value
if (term !== "") {
searchContents(term)
@@ -35,4 +27,4 @@ registerHandlers(debounce((e) => {
))
.then(results => displayResults(results))
}
}))
})