-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unnecessary type assertions from useReport.ts #5884
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
if (timer !== null) { | ||
clearTimeout(timer.current as ReturnType<typeof setTimeout>); | ||
if (timer.current !== null) { | ||
clearTimeout(timer.current); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're in here, semantically it would make sense to also set timer.current = null;
after clearing, although the clearTimeout
API doesn't really care if it's called with invalid ids
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ! I added on 153cd4c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I believe this is better for type-safety