I have the usual method of this (Using Blaze):
Template.dashboard.onRendered(function() {
Meteor.call('corpusCount', (error, result) => {
if (error) {
Session.set('corpusCount', 0);
} else {
Session.set('corpusCount', result);
}
});
then in a helper:
Template.dashboard.helpers({
corpusCount() {
if(Session.get('corpusCount')) {
return Session.get('corpusCount');
} else {
return 0;
}
}
To avoid sessions, I could do this:
Meteor.call('corpusCount', (error, result) => {
if (error) {
} else {
document.getElementById('accountCorpusCount').innerText = result;
}
});
Are there any known performance issues or benefits with either method? Or, does blaze do something like innerText under the hood with {{}}?