Fix eslint errors

This commit is contained in:
Gregory Schier
2023-03-11 23:29:25 -08:00
parent f846fa8dbc
commit 971cd02142
15 changed files with 64 additions and 87 deletions

View File

@@ -1,6 +1,8 @@
export function debounce(fn: (...args: any[]) => any, delay: number) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function debounce(fn: (...args: any[]) => void, delay: number) {
let timer: ReturnType<typeof setTimeout>;
const result = function (...args: Parameters<typeof fn>) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const result = function (...args: any[]) {
clearTimeout(timer);
timer = setTimeout(() => fn(...args), delay);
};