123456789101112131415161718192021222324 |
- // Fonction hypothétique...
- function getFacebookLikeCount() {}
- currentLikeCount = 0;
- Meteor.setInterval(function () {
- var postId;
- if (Meteor.user() && postId === Session.get('currentPostId')) {
- getFacebookLikeCount(Meteor.user(), Posts.find(postId).url, function (err, count) {
- if (!err) {
- currentLikeCount = count;
- }
- });
- }
- }, 5 * 1000);
- // Insert in "post_item.js".
- Template.postItem.helpers({
- likeCount: function () {
- return currentLikeCount;
- }
- });
|