How to respond effectively to a function in a meteor?
I have a function that does some gui logic and I need this to run every time the meteorite updates the template reactively.
I tried to put the code in Template.myTemplate.helpers as shown below, but then nothing works at all.
Template.ResourceManager.helpers({
names : function(){
myFunction();
return resources.findOne({age : 20}).names;
}
});
Basically, I need myFunction () to run every time something changes in resources. I cannot find a way to do this. I've tried looking into autoRun along with cursor.dependency, but I really don't understand how they work, or how to apply them here. Any help would be greatly appreciated! Thank!
+3
source to share