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

autoBind function needs a filter method #3

Closed
jlyonsmith opened this issue Aug 16, 2017 · 2 comments
Closed

autoBind function needs a filter method #3

jlyonsmith opened this issue Aug 16, 2017 · 2 comments

Comments

@jlyonsmith
Copy link

Thanks for creating this project. I see that there has been at least one fork that added React specific filters when choosing which methods to bind. I'd really like to make this a more general purpose mechanism. For example, if you just wanted to bind all methods that started with the word handle which is the convention that I use for event handler methods in React apps. I propose:

  1. Adding an optional filter method parameter that allows custom filtering of the bind
  2. Adding a predefined filter function to exclude standard React methods.

Neither of these additions would affect current users in any way. If I prepared a PR would you be interested in merging it?

@sindresorhus
Copy link
Owner

Sure, PR welcome :)

@jlyonsmith
Copy link
Author

Sorry for the long response here. I created a PR, but I felt it was a bit too much as I basically rewrote the library in ES6 with a different test tool. So I create a new package, auto-bind2 based on your excellent work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants