Google News
logo
Meteor.js - Interview Questions
What is tracker in Meteor?
Tracker is a small library that is used for auto update templates once the session data has changed. Tracker.autorun() method is used for tracking on session.
var data = 0  
   Session.set('sessionData', data);  
   Tracker.autorun(function () {  
      var sessionValue = Session.get('sessionData');  
      console.log(sessionValue)  
   });  

   Template.myTemplate.events({  
      'click #myButton': function() {  
         Session.set('sessionData', data++);  
      }  
   });
Advertisement