introduce debounce on output updates + linked box

This commit is contained in:
David Meincke
2022-03-23 21:31:04 +01:00
parent f25f3daf7f
commit ad53ae9695
15 changed files with 211 additions and 45 deletions
+16
View File
@@ -0,0 +1,16 @@
export function debounceManager(debounceTime: number): { ensureDebounce: (fn: Function) => void } {
var curHandle: number | null = null;
return {
ensureDebounce: (fn: Function) => {
if (curHandle != null) {
clearInterval(curHandle);
curHandle = null;
}
curHandle = setTimeout(() => {
fn();
}, debounceTime);
}
}
}