-
-
Notifications
You must be signed in to change notification settings - Fork 2
refactor(useKeydown): optimize keydown event handling #8
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
base: master
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| if (getCurrentScope()) { | ||
| const stopListening = () => { |
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.
What is your philosophy behind const functions and when to use them?
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.
I used to write functions via const, but on top level it's converted by antfu eslint plugin automatically, unlike nesting 🥲
johnleider
left a comment
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.
I may be reading this wrong, but I really thing you might benefit from using useRegistry instead of managing handlerMap.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
commit: |
242bb48 to
24efe46
Compare
use registrar and single event listener to listen to keydown in a more performant way