onReady subscription hooks for better refresh/syncs

This commit is contained in:
Jeff Bryner 2014-07-23 09:51:40 -07:00
Родитель 66d4fe0a87
Коммит c8aca1c1c2
2 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -256,9 +256,14 @@ if (Meteor.isClient) {
}; };
Deps.autorun(function(comp) { Deps.autorun(function(comp) {
//console.log(comp); //subscribe to the number of alerts
//and to the summary of alerts
//if the count changes, refresh ourselves in a non-reactive way
//to lessen the meteor hooks since we don't care about field-level changes.
Meteor.subscribe("alerts-count"); Meteor.subscribe("alerts-count");
Meteor.subscribe("alerts-summary"); Meteor.subscribe("alerts-summary", onReady=function(){
Deps.nonreactive(refreshAlertsData);
});
cnt=alertsCount.findOne(); cnt=alertsCount.findOne();
$('#alertsearchtext').val(Session.get('alertsearchtext')); $('#alertsearchtext').val(Session.get('alertsearchtext'));
if ( cnt ){ if ( cnt ){

Просмотреть файл

@ -90,11 +90,13 @@ if (Meteor.isClient) {
} }
Deps.autorun(function() { Deps.autorun(function() {
Meteor.subscribe("healthfrontend"); Meteor.subscribe("healthfrontend",onReady=function(){
Deps.nonreactive(refreshChartData);
});
Meteor.subscribe("healthescluster"); Meteor.subscribe("healthescluster");
Meteor.subscribe("healthesnodes"); Meteor.subscribe("healthesnodes");
Meteor.subscribe("healtheshotthreads"); Meteor.subscribe("healtheshotthreads");
refreshChartData();
}); //end deps.autorun }); //end deps.autorun
}; };