stubailo / meteor-reactive-method

Call methods synchronously inside Tracker.autorun [deprecated]
https://atmospherejs.com/simple/reactive-method
MIT License
98 stars 11 forks source link

Don't auto update when the Collection updated. #12

Closed thearabbit closed 9 years ago

thearabbit commented 9 years ago

I have

// --------------Server
Meteor.methods({
   getData: function(){
      var data = Collection.Customer.find().fetch();
      return data;
   }
})

// ----------------Client
// Template
{{#each data}}
...............
{{/each}}

// Helper
data: function(){
   var data = ReativeMethod.calle('getData');
   return data;
}

Don't auto update, when I update collection. Please help me.

stubailo commented 9 years ago

@thearabbit if you want to push data from the server to the client, you should use Meteor.publish and Meteor.subscribe. That's what they are for. This package is only for requesting data, which means later updates are not pushed.

thearabbit commented 9 years ago

Thanks, I want to generate reports the related with many collections So I can't use pu/sub. Have any way to do???

stubailo commented 9 years ago

You can publish several collections at once with a publication. You can also use a custom publication to publish transformed data: http://docs.meteor.com/#/full/meteor_publish

Check out how to use this.added/this.changed. It's not super easy to use, but it's designed for this particular case.

thearabbit commented 9 years ago

Thanks again, I will check it.