Skip to content

Conversation

@liymax
Copy link

@liymax liymax commented Jun 12, 2021

make the parameter "handler" of .off() be optional. when it is empty, clear all listener of this type

if (handlers) {
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
if (!handler) {
handlers.splice(0, handlers.length);
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
handlers.splice(0, handlers.length);
handlers.length = 0;

@developit
Copy link
Owner

This is a duplicate of #124 and #72.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants