diff --git a/src/cache.ts b/src/cache.ts index 180e049..f633de1 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -31,6 +31,6 @@ export default function cache (fn: (str: any) => any): (str: any) => any { return function cachedFn (this: any) { const str = arguments[0] const hit = cache[str] - return cache.hasOwnProperty(str) ? hit : (cache[str] = fn.apply(this, arguments)) + return cache.hasOwnProperty(str) ? hit : (cache[str] = fn.apply(this, arguments as any)) } } diff --git a/src/debounce.ts b/src/debounce.ts index 0fcc726..6608aec 100644 --- a/src/debounce.ts +++ b/src/debounce.ts @@ -11,7 +11,7 @@ * window.addEventListener('resize', debounce(function () { console.log(this) }, 100)) */ export default function debounce ( - func: () => void, + func: (...args: any[]) => void, wait: number = 50 ): (...args: any[]) => void { let timer: any = null