Permalink
Browse files

using _.bindAll since 0.5.2 is IMHO deprecated.

Documentation suggest adding context as a third parameter to bind. I also noticed that _.bindAll is less clear to newcomers.
  • Loading branch information...
1 parent 5c1c758 commit a40ccfc57740f3b7479bd58034918d28cfeb0b52 @OpenGrid OpenGrid committed Jan 17, 2012
Showing with 4 additions and 6 deletions.
  1. +4 −6 README.md
View
@@ -1646,9 +1646,8 @@ var TodoView = Backbone.View.extend({
// The TodoView listens for changes to its model, re-rendering. Since there's
// a one-to-one correspondence between a **Todo** and a **TodoView** in this
// app, we set a direct reference on the model for convenience.
- initialize: function() {
- _.bindAll(this, 'render', 'close');
- this.model.bind('change', this.render);
+ initialize: function() {
+ this.model.bind('change', this.render, this);
this.model.view = this;
},
...
@@ -1703,9 +1702,8 @@ define([
// The TodoView listens for changes to its model, re-rendering. Since there's
// a one-to-one correspondence between a **Todo** and a **TodoView** in this
// app, we set a direct reference on the model for convenience.
- initialize: function() {
- _.bindAll(this, 'render', 'close');
- this.model.bind('change', this.render);
+ initialize: function() {
+ this.model.bind('change', this.render, this);
this.model.view = this;
},

0 comments on commit a40ccfc

Please sign in to comment.