kadirahq/subs-manager

Bug in the code?

elie222 opened this issue · 0 comments

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.