I have a query to a Mongo collection inside the componentWillMount function of a React component, like this:
componentWillMount() {
Meteor.subscribe('SomePub');
Tracker.autorun(() => {
var data = SomeColl.find({}).fetch();
console.log(data);
});
}
but the Tracker.autorun
function does not run when the data changes, hence data
does change form being undefined
. Any ideas?