Skip to content

can _.bindAll accept an array of function names #1996

@bishopZ

Description

@bishopZ

I wrote this Stackoverflow issue for this common (imo) Underscore + Backbone pattern.
http://stackoverflow.com/questions/27697299/passing-an-array-of-names-to-bindall-arguments-list-has-wrong-type/

The best answer was to do this:

_.bindAll.apply(_, [this].concat(_.values(this.events)));

Would be much more readable if it could be written like this:

_.bindAll(_.values(this.events));

Many of the Underscore functions accept both a string or an array of strings, why not this one?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions