Backbone.Rpc
Backbone.Rpc copied to clipboard
Error: bindAll must be passed function names
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
_.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.
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
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 Sure! That would be fine. I added some basic documentation and am actively using/maintaining the library.
:+1: