joshreep / captain-hook Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
As a developer, I would like to have a hook that can make it easy to detect when a user is pressing a specific key on their keyboard so that I can fire off a callback on keypress.
useEventListener
hook to make registration and unregistration easier.Proposed Signature:
export default function useKeyPress<T extends Element>(targetKey: string, element?: T): boolean
window
object should be used to bind the listener.true
when the target key is being pressed and false
when the target key is not being pressed.false
when any key other than the target key is pressed.README.md
file that provides good documentation about how the user will use the hook.Is your feature request related to a problem? Please describe.
I'm always frustrated when I have lots of unnecessary renders and I'm not sure how to find what's causing it
Describe the solution you'd like
I'd like a hook that prints out in the console why a component rerendered if no values changed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.