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

unbind method + unit tests + method argument #73

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bfirsh
Copy link

@bfirsh bfirsh commented Jan 4, 2013

This is building upon #65 and #69. I've added a "method" argument so you can specify exactly which handler to remove, like in most event systems (e.g. on('event', method) / off('event', method)).

There's a bit of undefined behaviour in the unbind method which needs a design decision though. If the scope is not set, then calling just unbind('a') will only remove handlers for "a" in the current scope. I think I'd expect it to remove all handlers for "a", like calling off('event') in an event system. Thoughts?

@bfirsh
Copy link
Author

bfirsh commented Jan 4, 2013

It also doesn't take into account comma-separated keys or modifiers. I'm doing some work on that now, but it means teasing out the parsing code from assignKey().

@sandinmyjoints
Copy link

This is much needed. Thanks for working on it. I'd vote for unbind('a') to remove all handlers, since you can already get the other functionality by supplying the scope: unbind('a', curScope).

@OliverJAsh
Copy link

+1

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.

4 participants