-
Notifications
You must be signed in to change notification settings - Fork 481
Add clear() function #104
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 clear() function #104
Conversation
Size Change: +51 B (5%) 🔍 Total Size: 981 B
|
|
I think I prefer this version, but I'm thinking of ways to offset the size impact. Good call on the method name too, using clear is "free" since it's already in the dictionary due to map.clear(). |
|
Regarding size: This is the size output when I run So still below 200 B on modern gz. :) |
|
@developit Is there any chance you will merge and tag this in the next week or so? (Otherwise I'll create my own fork in the meantime.) |
|
@jaylinski would you be okay if we merged the |
Yes, would be okay for me. |
|
closing now that #105 is merged! |
Description
Adds a
clear()function, as discussed in #72 (comment).As noted in #72 (comment), implementing a "clear all events"-functionality via
off()can be problematic, since events passed in the mittall-param will get removed.The
clear()-method is more expressive in what it does.Is an alternative to #105.
Is
Map.clear()supported by all major browsers?Yes. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear
Relates to
#70 #72 #102