The following is an example of a function call withTracker()that includes the use of consecutive parentheses in Javascript.
export default withTracker(props => {
const handle = Meteor.subscribe('todoList', props.id);
return {
currentUser: Meteor.user(),
listLoading: !handle.ready(),
tasks: Tasks.find({ listId: props.id }).fetch(),
};
})(Foo);
The first reactive container for React components in Meteor was a feature createContainer(), and it was named as follows for the same purpose as the previous one.
export default FooContainer = createContainer(props => {
const handle = Meteor.subscribe('todoList', props.id);
return {
currentUser: Meteor.user(),
listLoading: ! handle.ready(),
tasks: Tasks.find({ listId: props.id }).fetch(),
};
}, Foo);
What is the difference in performing these two functions?
source
share