Skip to content

Commit

Permalink
Follow new eslint alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Jul 22, 2023
1 parent abd8fe6 commit 7e6bdd5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/common/timerHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ export const useInterval = (callback: () => void, delay: number | null): void =>
return;
}

const id = setInterval(() => savedCallback.current(), delay);
const id = setInterval(() => {
savedCallback.current();
}, delay);

return () => clearInterval(id);
return () => {
clearInterval(id);
};
}, [delay]);
};

0 comments on commit 7e6bdd5

Please sign in to comment.