We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
个人觉得下面这样好一些:
proto.allOff = function(eventName) { if (eventName) { this.__events[eventName] = [] } else { this.__events = {} } };
The text was updated successfully, but these errors were encountered:
@KaiOrange 恩恩,确实有这个问题,感谢指出~ 要不要发起一个 PR ?
Sorry, something went wrong.
@KaiOrange 不过这样的话,当删除一个不存在的事件时,比如 'test' 事件时,我们就会设置 __events.test = [],这个又是没有必要的,所以可以写成:
proto.allOff = function(eventName) { if (eventName) { if (this.__events[eventName]) this.__events[eventName] = [] } else { this.__events = {} } };
No branches or pull requests
个人觉得下面这样好一些:
The text was updated successfully, but these errors were encountered: