document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. //put this stuff in a common place
  2. Tests = new Meteor.Collection(\'tests\');
  3.  
  4. if(Meteor.isClient){
  5.  
  6.         Meteor.subscribe(\'tests-new\',function(){
  7.             Tests.find().observe({
  8.                 added: function(item){
  9.                         //here goes on add stuff
  10.                     },
  11.                 changed: function(nitem,oitem){
  12.                         //here goes on change stuff
  13.                     }
  14.             });
  15.         });
  16.  
  17. }
  18.  
  19. if(Meteor.isServer){
  20.  
  21.     Meteor.publish(\'tests-new\', function() {
  22.         return Tests.find();
  23.     });
  24.  
  25. }
');