Created
April 30, 2015 13:30
-
-
Save redwraith2/1f0979e70928c3b2716b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Exhibit 1: They're the same | |
Template.notifications.helpers({ | |
notifications: function(){ | |
return Notifications.find({userId: Meteor.userId(), read: false}); | |
}, | |
notificationCount: function(){ | |
return Notifications.find({userId: Meteor.userId(), read: false}).count(); | |
} | |
}); | |
//Exhibit 2: One references the other. | |
Template.notifications.helpers({ | |
notifications: function(){ | |
return Notifications.find({userId: Meteor.userId(), read: false}); | |
}, | |
notificationCount: function(){ | |
return this.notifications().count(); | |
} | |
}); | |
//Why do these behave differently? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment