-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Detach custom event listener #384
Conversation
src/decorators/customEvent.js
Outdated
return map[event] | ||
} | ||
|
||
return void 0 |
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.
I've not seen this return type before - I'd use 'undefined' if they behave similarly.
src/decorators/customEvent.js
Outdated
@@ -33,7 +33,27 @@ const setUntargetItems = function (currentTarget, targetArray) { | |||
} | |||
} | |||
|
|||
let customListener | |||
const customListeners = { | |||
registry: new WeakMap(), |
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.
I'm afraid we won't be able to accept the PR until we can build the standalone with babel-polyfill. Is there a way to use a standard object instead?
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.
We can define a property on given object. This is how WeakMap is usually polyfilled.
Great, the new approach looks reasonable. Can you please add a comment that this is essentially a polyfill for WeakMap? I'll see if I can try it out. |
Done. |
🎉 This PR is included in version 3.6.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #370
This PR introduces usage of WeakMap, therefore it may be a breaking change, since WeakMap is unsupported in non-ES6 environments and requires a polyfill.
All projects using babel-polyfill should be unaffected.