title: Can I use a global helper to pass data into onRendered?
body: <p>I'm trying to set a variable in the onRendered callback equal to the value from the <code>active</code> global helper.  My global helpers are defined as follows:</p>
  
  <p>client/lib/helpers.js</p>
  
  <pre><code>//all possible calculations//
  getResults = function(valuationId,targetId){
      var valuation = Valuations.findOne({_id: valuationId});
      var targetTicker = Companies.findOne({_id:targetId}).ticker;
      var targetData = CompaniesData.findOne({ticker: targetTicker});
      return {
          peFy1: targetData.epsFy1 * valuation.priceEarningsFy1,
          peFy2: targetData.epsFy2 * valuation.priceEarningsFy2
          //more//
      }
  };
  
  //choose one value from above, based on several other variables//
  Template.registerHelper('active',function(){
      var valuationId = this._id;
      var targetId = this.targetId;
      var valuationPeriod = this.valuationPeriod;
          switch (valuationPeriod) {
              case "FY1"
                  return getResults(valuationId, targetId).peFy1;
                  break;
              case "FY2":
                  return getResults(valuationId, targetId).peFy2;
                  break;
          //more cases//
  </code></pre>
  
  <p>I can get and use a single value directly from <code>getResults</code> with the last line below.</p>
  
  <pre><code>Template.ValuationBase.onRendered (function () {
      var targetId = Template.parentData(0).targetId;
      var valuationId = Template.parentData(0)._id;
      var valuationActive = getResults(valuationId,targetId).peFy1;
  </code></pre>
  
  <p>But I can't figure out how to get the value resulting from logic in the <code>active</code> helper.  I thought it would be <code>var valuationActive = active();</code> but that returns <code>not defined</code>.  I also saw <a href="https://stackoverflow.com/a/31559435/4168250">this answer</a> but it seems to be creating the function in the template JS, rather than referring to a helper.</p>
  
  <p>I'm sure this is a basic mistake in how I am calling the function.  Thank you.</p>