Skip to content
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

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

2wheeh
Copy link
Contributor

@2wheeh 2wheeh commented Apr 13, 2024

I believe this is better for type-safety

Copy link

vercel bot commented Apr 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 13, 2024 8:07pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 13, 2024 8:07pm

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 13, 2024
if (timer !== null) {
clearTimeout(timer.current as ReturnType<typeof setTimeout>);
if (timer.current !== null) {
clearTimeout(timer.current);
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

@potatowagon potatowagon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@potatowagon potatowagon changed the title Remove unnecessary type assertions Remove unnecessary type assertions from packages/lexical-playground/src/hooks/useReport.ts Apr 15, 2024
@potatowagon potatowagon changed the title Remove unnecessary type assertions from packages/lexical-playground/src/hooks/useReport.ts Remove unnecessary type assertions from useReport.ts Apr 15, 2024
@StyleT StyleT merged commit aba3160 into facebook:main Apr 16, 2024
45 checks passed
@acywatson acywatson mentioned this pull request Apr 16, 2024
@2wheeh 2wheeh deleted the unnecessary-type-assertion branch April 17, 2024 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants