我不明白,从react-meteor-data理解流星订阅
import { createContainer } from 'meteor/react-meteor-data';
export default FooContainer = createContainer(() => {
// Do all your reactive data access in this method.
// Note that this subscription will get cleaned up when your component is unmounted
var handle = Meteor.subscribe("todoList", this.props.id);
return {
currentUser: Meteor.user(),
listLoading: ! handle.ready(),
tasks: Tasks.find({listId: this.props.id}).fetch(),
};
}, Foo);
为什么建议stop
订阅当Component
被卸除,但是,在这种情况下这个例子中,不设法阻止什么? Meteor如何处理订阅?什么时候收集清洁?每次执行跟踪器回调时,订阅是否都堆叠起来?
或者是流星很聪明,知道何时Meteor.subscribe
被调用,并且与订阅有关吗?
这更有意义,现在。谢谢! –