Meteor.autorun vs Tracker.autorun?

What is the difference between Meteor.autorun and Tracker.autorun ?

  • Are these just aliases?
  • is outdated?
  • Is there any instance where one is preferable to the other?

I know well the difference in using this.autorun in the template lifecycle callbacks, but I saw that the two are used interchangeably and just want to be sure that I did not miss the trick.

+6
source share
1 answer

Well, this is easy to detect with the operator.

This will be false because it is not the same function:

 (function() {} === function() {}) 

Try using two autorun :

 (Meteor.autorun === Tracker.autorun) 

This returns true . So yes, this is just a pure alias.
However, only Tracker.autorun documented . I suspect some old API is left for compatibility ...
Let me check the Meteor code on GitHub !

File: deprecated.js

 Meteor.autorun = Tracker.autorun; 

This is in deprecated.js , it talks about things //Deprecated functions and some backward compatibility with Meteor 0.5.4. It seems pretty clear which one you should use.
You can find other old timers there, such as Deps ...

+13
source

All Articles