Backbone.Rpc icon indicating copy to clipboard operation
Backbone.Rpc copied to clipboard

Error: bindAll must be passed function names

Open akinnee opened this issue 10 years ago • 5 comments

Immediately ran into this issue when calling new Backbone.Rpc(). I'm using underscore.js v1.5.2, which throws an exception with the following code (found in Backbone.Rpc).

// fix issue with the loss of this
_.bindAll(this);

I suspect this code isn't actually accomplishing anything. See the docs for what bindAll does and you'll see that it requires function names to be passed in to actually do anything. http://underscorejs.org/#bindAll

akinnee avatar Feb 06 '14 21:02 akinnee

_.bindAll(this); was removed in underscore.js 1.5:

Removed the ability to call _.bindAll with no method name arguments. It's pretty much always wiser to white-list the names of the methods you'd like to bind.

xsleonard avatar Mar 17 '14 20:03 xsleonard

Yep. It's pretty obvious that Backbone.Rpc is no longer maintained at this point. I ended up writing my own. It's open sourced, tested, and I'm using it in a production app, but I haven't written any docs yet. Maybe by the time someone sees this I'll have it well documented. https://github.com/akinnee/Backbone.RPC2

akinnee avatar Mar 18 '14 18:03 akinnee

Even tho the library is not maintained anymore, I will go ahead and change this, to keep it working at least.

@akinnee Is it okay for you if I add a note to the readme delegating people over to your library?

asciidisco avatar Mar 30 '14 19:03 asciidisco

@asciidisco Sure! That would be fine. I added some basic documentation and am actively using/maintaining the library.

akinnee avatar Mar 31 '14 00:03 akinnee

:+1:

asciidisco avatar Mar 31 '14 07:03 asciidisco