meteor-vue / vue-meteor-tracker

Use Meteor Tracker reactivity inside Vue components
90 stars 20 forks source link

$subReady returning false when function is used in $subscribe #56

Closed ashish979 closed 5 years ago

ashish979 commented 5 years ago

@Akryum

Below the problem that I am facing:

    meteor: {
      $subscribe: {
        'Time': [],
        'Organisation': [],
        'OrganisationData' () {
          return [this.organisationIds]
        }
      },
      OrganisationCursor () {
        return Organisation.find({})
      },
      organisationIds: function() {
        this.OrganisationCursor && this.OrganisationCursor.map((organisation) => organisation._id);
      }
    }

I have passed a meteor reactive property as an argument to OrganisationData subscription. The publication on backend is called and returning data as well. But $subReady.OrganisationData is always false.

Below is the link to the repository to reproduce the problem. https://github.com/ashish979/meteor-vue-example

Any help would be appreciated.

Thanks

ashish979 commented 5 years ago

Found the issue. It was due to missing return statement in OrganisationData publication. Disadvantage of using coffeescript -_-.