kadirahq / subs-manager

Subscriptions Manager for Meteor
MIT License
358 stars 36 forks source link

Bug in the code? #72

Open elie222 opened 8 years ago

elie222 commented 8 years ago

Hi,

I'm trying to debug an issue I'm having and I just came across the following code:

  SubsManager.prototype.subscribe = function() {
  var self = this;

  if(Meteor.isClient) {
    var args = _.toArray(arguments);
    this._addSub(args);

    return {
      ready: function() {
        self.dep.depend();
        return self._ready; // BUG?
      }
    };
  } else { ... }

I'm confused as to why a subscription is returning self._ready which determines whether all subs in the subsmanager are ready. Apologies if this code is fine and it's just my misunderstanding.