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
I slightly modified the method in order to accept functions instead of just function names.
var bind = function(events, context, namespace) { _.each(events, function(method, trigger) { var parts = trigger.split(/\s*\+\s*/), key = _.last(parts), modifiers = _.initial(parts), callback = null; if (_.isFunction(context[method])) { callback = _.bind(context[method], context); } else if (_.isFunction(method)) { callback = _.bind(method, context); } if (eventsNamespace[namespace]) { eventsNamespace[namespace].push(buildHandler(key, modifiers, callback)); } else { eventsNamespace[namespace] = [buildHandler(key, modifiers, callback)]; } }); return context; };
The text was updated successfully, but these errors were encountered:
Make a PR?
Sorry, something went wrong.
No branches or pull requests
I slightly modified the method in order to accept functions instead of just function names.
The text was updated successfully, but these errors were encountered: