Some self=this adjustments and now basic apps work

This commit is contained in:
Naomi Seyfer
2012-12-12 17:01:42 -08:00
committed by David Glasser
parent cc2a5d3ffb
commit 6873f4acc1
2 changed files with 6 additions and 1 deletions

View File

@@ -935,6 +935,7 @@ _.extend(Meteor._LivedataConnection.prototype, {
},
_pushUpdate: function (updates, collection, msg) {
var self = this;
if (!_.has(updates, collection)) {
updates[collection] = [];
}
@@ -1050,6 +1051,7 @@ _.extend(Meteor._LivedataConnection.prototype, {
},
_process_complete: function (msg, updates) {
var self = this;
// Process "sub ready" messages. "sub ready" messages don't take effect
// until all current server documents have been flushed to the local
// database. We can use a write fence to implement this.

View File

@@ -704,7 +704,8 @@ _.extend(Meteor._LivedataSubscription.prototype, {
},
onStop: function (callback) {
this._stopCallbacks.push(callback);
var self = this;
self._stopCallbacks.push(callback);
},
added: function (collectionName, id, fields) {
@@ -714,10 +715,12 @@ _.extend(Meteor._LivedataSubscription.prototype, {
},
changed: function (collectionName, id, fields) {
var self = this;
self._session.changed(self._subscriptionId, collectionName, id, fields);
},
removed: function (collectionName, ids) {
var self = this;
_.each(ids, function(id) {
// we don't bother to delete sets of things in a collection if the
// collection is empty. It could break below, where we iterate over