-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Only one real listener per listen
call
#2535
Conversation
Actually use event listener cache correctly Fixes #2534 Polymer Gestures creates a new bound handler for every `listen` call
Is there a test we can put in place for this? |
@samccone yep |
A good test might be..
|
this._listen(node, eventName, | ||
this._createEventHandler(node, eventName, methodName)); | ||
var handler = this._recallEventHandler(this, eventName, node, methodName); | ||
// reuse cache'd handler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍻
Relevant for PolymerElements/iron-selector#64 |
@sorvell or @kevinpschaaf PTAL |
@@ -141,6 +141,41 @@ | |||
assert.deepEqual(el._removed[3], {target: 'div', event: 'bar'}); | |||
}); | |||
}); | |||
|
|||
suite('Event Listener Cache', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woot
Gestures have counter code that should not be re-added with multiple identical `listen` calls
LGTM |
Only one real listener per `listen` call
Actually use event listener cache correctly
Fixes #2534 Polymer Gestures creates a new bound handler for every
listen
call