我不明白,從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
被調用,並且與訂閱有關嗎?
這更有意義,現在。謝謝! –