Skip to content

Commit

Permalink
Merge pull request #205 from L4legenda/fix-useMinilinksSubscription-r…
Browse files Browse the repository at this point in the history
…erender

fix: rerender useMinilinksSubscription
  • Loading branch information
Konard authored Aug 19, 2023
2 parents d2dab54 + b017a84 commit 294cee4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imports/minilinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ export function useMinilinksSubscription<L extends Link<number>>(ml, query: Quer
const [iteration, setIteration] = useState(0);
useEffect(() => {
const iterationsInterval = setInterval(() => {
setIteration(iteration === Number.MAX_SAFE_INTEGER ? 0 : iteration+1)
setIteration((i: number) => i === Number.MAX_SAFE_INTEGER ? 0 : i+1)
}, 1000);
return () => clearInterval(iterationsInterval);
}, []);
Expand Down

0 comments on commit 294cee4

Please sign in to comment.