Reputation: 45295
I have a file client/events/entity.js where I want to bind some function to multiple events. I can put this function in the same file:
// save changes
function save_changes(id) {
// ...
}
Template.bookmarks.events({
'click .save_changes' : function(e,t) {
save_changes(e.target.id);
}
/// ...
}
Or it will be better if I move this function to client/lib/save_changes.js file ?
Upvotes: 0
Views: 48
Reputation: 44831
There's no reason to move it to a different file; you'll just trigger an additional server request when a user visits the page, which will decrease overall performance.
Upvotes: 1