Is this a good practice?
dictionaryLookup = function (lookupType, index) {
var dict = ChartDictionary.findOne({"lookup_type": lookupType, "lookup_id": index});
return dict.lookup_label;
}
Template.registerHelper('dictionaryLookup', function (lookupType, index) {
return dictionaryLookup(lookupType, index);
});
This allows me to use dictionaryLookup as a javascript function when needed, and also to use dictionaryLookup as a template helper in my templates…
Reason being, I’m moving from building my own tables in the template with an EACH block, to using https://github.com/aslagle/reactive-table and I’m finding that things that used to be template helpers now need to be javascript functions.