Skip to content

Commit bb53997

Browse files
implement debounce properly
1 parent 90a8fa6 commit bb53997

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ <h2>Errors</h2>
100100
var timeout = null;
101101
source.addEventListener("input", () => {
102102
if (timeout) clearTimeout(timeout);
103-
setTimeout(async () => {
103+
timeout = setTimeout(async () => {
104104
console.textContent = "";
105105
errors.textContent = "";
106106
try {
@@ -110,7 +110,7 @@ <h2>Errors</h2>
110110
output.innerHTML = "";
111111
throw e;
112112
}
113-
}, 500);
113+
}, 100);
114114
});
115115
}
116116
main();

0 commit comments

Comments
 (0)