title: Using requestAnimationFrame in angular2
body: <p>I want to implement infinite scroll in angular2 which </p>
  
  <ol>
  <li>automatically removes DOM which are out of viewport. </li>
  <li>uses requestAnimationFrame instead onscroll.</li>
  </ol>
  
  <p>I noticed above was implemented using Mithriljs which is available in below link. I am confused on how to use requestAnimationFrame  and build a class called ScrollListener in angular2. Please suggest?</p>
  
  <p><a href="https://github.com/flarum/core/blob/master/js/lib/utils/ScrollListener.js" rel="noreferrer">https://github.com/flarum/core/blob/master/js/lib/utils/ScrollListener.js</a></p>
  
  <p><a href="https://github.com/flarum/core/blob/master/js/forum/src/components/PostStream.js" rel="noreferrer">https://github.com/flarum/core/blob/master/js/forum/src/components/PostStream.js</a></p>
  
  <p><strong>PS:</strong> Sorry for my English. I am not a native English speaker.</p>