Skip to content

Instantly share code, notes, and snippets.

@shrop
Last active August 29, 2015 14:19
Show Gist options
  • Save shrop/9ac76dca956759f87c63 to your computer and use it in GitHub Desktop.
Save shrop/9ac76dca956759f87c63 to your computer and use it in GitHub Desktop.
Template.recentNotifications.helpers({
// Check the current notification type for template usage.
notificationType: function (type) {
return this.type === type;
},
// Return set of notifcation cursors.
notifications: function () {
return Notifications.find( {}, { sort: { createdAt: -1 } } );
},
// Helper for comment related notification data.
comment: function() {
Meteor.subscribe('commentPostId', this.sourceId);
return Comments.findOne(this.sourceId);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment