Skip to content

Commit

Permalink
Fix streamich#2383 useThrottleFn fail in development
Browse files Browse the repository at this point in the history
  • Loading branch information
EnixCoda committed Oct 19, 2023
1 parent 325f5bd commit 6c0046c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/useThrottleFn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const useThrottleFn = <T, U extends any[]>(fn: (...args: U) => T, ms: number = 2

useUnmount(() => {
timeout.current && clearTimeout(timeout.current);
timeout.current = undefined;
nextArgs.current = undefined;
});

return state;
Expand Down

0 comments on commit 6c0046c

Please sign in to comment.