title: How to do page reveal animations with IronRouter?
body: <p>I'm using meteor &amp; IronRouter, and trying to do some javascript-driven animations when the template is ready/rendered.</p>
  
  <p>However, the IR hook events don't seem to fire when they should.</p>
  
  <p>onBeforeAction and onAfterAction only seem to fire before the new page is rendered.
  So there is no updated DOM to animate.</p>
  
  <p>I also tried overriding the action, calling render myself, and then animating.
  however, the DOM is still not updated... even using <code>Meteor.defer</code></p>
  
  <pre><code>    action: -&gt;          
          this.render()  # works ok
          Meteor.defer -&gt;
              Template.SceneView.animateScene()  
  </code></pre>
  
  <p>This was still getting called while the old template was present. I guess since Meteor is still updating async-ly, and so defer() didn't really defer...</p>
  
  <p>So a hack around this is to call the animate function from the template itself, and then also use <code>Meteor.defer</code> to call the animation, so the DOM is updated.</p>
  
  <p>The <a href="http://meteor.github.io/blaze/docs.html#template_rendered" rel="nofollow">Blaze rendered() hook</a> only fires once on template creation.</p>
  
  <p>Separately there are some new ui_hooks in Blaze, but these seem to be before insert or deletes happen. I guess I could use this and take over the whole DOM manipulation but that seems like overkill for just playing some animations when a page is ready...
  <a href="https://github.com/percolatestudio/transition-helper/blob/master/transition-helper.js" rel="nofollow">https://github.com/percolatestudio/transition-helper/blob/master/transition-helper.js</a></p>