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

Add TypeScript declarations #5

Merged
merged 2 commits into from
Mar 5, 2019
Merged

Add TypeScript declarations #5

merged 2 commits into from
Mar 5, 2019

Conversation

wKovacs64
Copy link
Contributor

(...and also fixed a couple typos)

The following usage will get you typed parameters to your handler function:

useEventListener<React.KeyboardEvent>('keydown', ({ key, shiftKey }) => {
  /* sweet, `key` is a string and `shiftKey` is a boolean */
});

Copy link
Owner

@donavon donavon left a comment

Choose a reason for hiding this comment

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

Nice! Thank you.

@donavon donavon merged commit 8494f30 into donavon:develop Mar 5, 2019
@donavon
Copy link
Owner

donavon commented Mar 5, 2019

@allcontributors[bot] please add @wKovacs64 for code, doc

@allcontributors
Copy link
Contributor

@donavon

I've put up a pull request to add @wKovacs64! 🎉

@donavon
Copy link
Owner

donavon commented Mar 5, 2019

@wKovacs64 published on npm as 0.1.3. Thanks again 🏆

https://www.npmjs.com/package/@use-it/event-listener

@wKovacs64 wKovacs64 deleted the types branch March 5, 2019 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants