Skip to content

Commit

Permalink
Removes startMeteorSubscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Théo mathieu committed May 27, 2016
1 parent b73612a commit db7bccd
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions src/components/Mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ export default {
const newData = this._meteorDataManager.calculateData();
this._meteorDataManager.updateData(newData);
}

if(this.startMeteorSubscriptions) {
console.warn('startMeteorSubscriptions is deprecated and will be removed soon. Please create your subscriptions in getMeteorData.');
this._meteorSubscriptionsManager = new MeteorSubscriptionsManager(this);
this._meteorSubscriptionsManager.getMeteorSubscriptions();
}
});


Expand Down Expand Up @@ -67,45 +61,6 @@ export default {
};





class MeteorSubscriptionsManager {
constructor(component) {
this.component = component;
this.computation = null;

this._meteorSubscriptionsDep = new Trackr.Dependency();

this._meteorDataChangedCallback = ()=>{this._meteorSubscriptionsDep.changed()};

Data.onChange(this._meteorDataChangedCallback);
}
dispose() {
if (this.computation) {
this.computation.stop();
this.computation = null;
}

Data.offChange(this._meteorDataChangedCallback);
}
stateOrPropsChanged() {

}
getMeteorSubscriptions() {
this.computation = Trackr.nonreactive(() => {
return Trackr.autorun((c) => {
this._meteorSubscriptionsDep.depend();

this.component.startMeteorSubscriptions();

});
});
}

}


// A class to keep the state and utility methods needed to manage
// the Meteor data for a component.
class MeteorDataManager {
Expand Down

0 comments on commit db7bccd

Please sign in to comment.