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
var evt = new Events(); var name = "event-name"; function handler(){} evt.on(name, handler); // 绑定第一次 evt.on(name, handler); // 绑定第二次 evt.emit(name); // handler 执行两次 evt.off(name, handler); // 解绑一次 evt.emit(name); // handler 不执行。
这个逻辑是否不正常?解绑时,在找到第一个 handler 后是否应该 break ?
The text was updated successfully, but these errors were encountered:
我怎么觉得合理。。
Sorry, something went wrong.
如果这是合理的,那更合理的就是不应该支持重复绑定。
No branches or pull requests
这个逻辑是否不正常?解绑时,在找到第一个 handler 后是否应该 break ?
The text was updated successfully, but these errors were encountered: