There is a function in my code that handles gui-logic, and I want it to be executed every time a template is updated reactively in Meteor.
I attempted to place the code within the Template.myTemplate.helpers section as shown below, but it caused everything to stop functioning.
Template.ResourceManager.helpers({
names : function(){
myFunction();
return resources.findOne({age : 20}).names;
}
});
Essentially, I need myFunction() to run whenever any changes occur in the resources collection. I have searched for ways to do this but have not found a suitable method. I have explored autoRun and cursor.dependency, but I am struggling to grasp their functionality and application in this scenario. Any assistance on this matter would be highly valued! Thank you!