use local `this` variable instead of .bind

pull/7738/head
Rich Harris 9 years ago committed by GitHub
parent 92cb77f8da
commit 21889f5d3d

@ -111,11 +111,14 @@ assign(Store.prototype, {
onchange: function(callback) {
this._changeHandlers.push(callback);
var store = this;
return {
cancel: function() {
var index = this._changeHandlers.indexOf(callback);
if (~index) this._changeHandlers.splice(index, 1);
}.bind(this)
var index = store._changeHandlers.indexOf(callback);
if (~index) store._changeHandlers.splice(index, 1);
}
};
},

Loading…
Cancel
Save