Skip to content

Commit

Permalink
fix: remove superfluous code, stricted typing
Browse files Browse the repository at this point in the history
  • Loading branch information
martinstark committed Feb 27, 2021
1 parent 6ec1412 commit 31aed5b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const throttle = <T extends (...args: any) => any>(
export const throttle = <T extends (...args: any[]) => any>(
fn: T,
delay: number
): [T | (() => void), () => void] => {
Expand All @@ -22,7 +22,6 @@ export const throttle = <T extends (...args: any) => any>(
return val;
},
() => {
wait = false;
cancelled = true;
clearTimeout(timeout);
},
Expand Down

0 comments on commit 31aed5b

Please sign in to comment.