I’m trying to understand what does and does not cause a subscription to reload in a React app. I have a news feed list on my page. Inserting, updating and deleting news items from Meteor methods or the Mongo shell doesn’t appear to change handle.ready() on the subscription. However, if I change the limit parameter on the subscription, it causes the subscription to reload and ready() momentarily becomes false.
Assuming no navigation or page reloading, is it true in React that after the initial subscription is ready, only a change to a parameter passed to the publish method will cause the publish method to fire again?
Here is my getMeteorData for context:
getMeteorData() {
const limit = this.state.limit;
let news = {};
let newsHandle = Meteor.subscribe("news", limit);
if( newsHandle.ready() ){
news = News.find({},{limit: limit}).fetch();
}
return {
news: news,
newsLoading: !newsHandle.ready()
}
}