Meteor Tracker Autorun and depen
2016-07-18 本文已影响67人
xqm_michael
Session variables
Database queries on Collections
Meteor.status
The ready() method on a subscription handle
Meteor.user
Meteor.userId
Meteor.loggingIn
ReactiveVar
ReactiveDict
定制自己的autorun
```javascript
myDep=newTracker.Dependency();
Tracker.autorun(function(comp){
myDep.depend();
console.log("Something has happened!");
});
```
在需要自动运行 autorun --> console.log("something has happened!")的地方调用myDep.changed();
zzz~~~