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 unlisten function #1740

Merged
merged 1 commit into from
Jun 8, 2015
Merged

Add unlisten function #1740

merged 1 commit into from
Jun 8, 2015

Conversation

dfreedm
Copy link
Member

@dfreedm dfreedm commented Jun 4, 2015

Keep generated event handlers, attach with WeakMap to host element
Add tests for events

Fixes #1639

bl = {};
hbl.set(target, bl);
}
bl[eventName] = handler;
Copy link
Contributor

Choose a reason for hiding this comment

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

var be = bl[eventName];
if (!be) {
  be = {};
}
be[methodName] = handler;

@dfreedm
Copy link
Member Author

dfreedm commented Jun 5, 2015

Not sure if be is necessary. Since both methodName and eventName are strings, we can just concatenate them with into one key in bl.

Keep generated event handlers, attach with WeakMap to host element
Add tests for events

Support multi-dispatch unlisten (must give event name and handler function
name).

Fixes #1639
@dfreedm
Copy link
Member Author

dfreedm commented Jun 8, 2015

PTAL @sorvell, multidispatch is supported now.

@kevinpschaaf
Copy link
Member

LGTUs

kevinpschaaf added a commit that referenced this pull request Jun 8, 2015
@kevinpschaaf kevinpschaaf merged commit 22daec6 into master Jun 8, 2015
@kevinpschaaf kevinpschaaf deleted the remove-listener branch June 8, 2015 23:17
adalinesimonian added a commit to adalinesimonian/iron-selector that referenced this pull request Jun 12, 2015
Polymer/polymer#1740 adds `unlisten` functionality, thus fixing blocking issue Polymer/polymer#1639. Now `iron-selector` can properly remove the event listener for the old activate event when it is changed instead of being forced to ignore unwanted calls handler calls.
blasten added a commit to PolymerElements/iron-selector that referenced this pull request Sep 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants