| 
														
															@@ -1,22 +1,15 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 // Fonction hypothétique... 
														 | 
														
														 | 
														
															 // Fonction hypothétique... 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 function getFacebookLikeCount() {} 
														 | 
														
														 | 
														
															 function getFacebookLikeCount() {} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-var _currentLikeCount = 0; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-var _currentLikeCountListeners = new Tracker.Dependency(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-currentLikeCount = function () { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-  _currentLikeCountListeners.depend(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-  return _currentLikeCount; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-}; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+var currentLikeCount = new ReactiveVar(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 Meteor.setInterval(function () { 
														 | 
														
														 | 
														
															 Meteor.setInterval(function () { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   var postId; 
														 | 
														
														 | 
														
															   var postId; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   if (Meteor.user() && postId === Session.get('currentPostId')) { 
														 | 
														
														 | 
														
															   if (Meteor.user() && postId === Session.get('currentPostId')) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     getFacebookLikeCount(Meteor.user(), Posts.find(postId).url, function (err, count) { 
														 | 
														
														 | 
														
															     getFacebookLikeCount(Meteor.user(), Posts.find(postId).url, function (err, count) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      if (!err && count !== _currentLikeCount) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        currentLikeCount = count; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        _currentLikeCountListeners.changed(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      if (!err) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        currentLikeCount.set(count); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       } 
														 | 
														
														 | 
														
															       } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     }); 
														 | 
														
														 | 
														
															     }); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   } 
														 | 
														
														 | 
														
															   } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -25,7 +18,8 @@ Meteor.setInterval(function () { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 // Insert in "post_item.js". 
														 | 
														
														 | 
														
															 // Insert in "post_item.js". 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 Template.postItem.helpers({ 
														 | 
														
														 | 
														
															 Template.postItem.helpers({ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   likeCount: function () { 
														 | 
														
														 | 
														
															   likeCount: function () { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    return currentLikeCount; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    return currentLikeCount.get(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   } 
														 | 
														
														 | 
														
															   } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 }); 
														 | 
														
														 | 
														
															 }); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+// Note : similar feature for dictionaries in package "reactive-dict". 
														 |