title: Typescript "this" inside a class method
body: <p>I know this is probably painfully basic, but i am having a tough time wrapping my head around it. </p>
  
  <pre><code>class Main
  {
       constructor()
       {
           requestAnimationFrame(this.update);  //fine    
       }
  
       update(): void
       {
           requestAnimationFrame(this.update);  //error, because this is window
       }
  
  }
  </code></pre>
  
  <p>It appears to be the case that I need a proxy, so lets say using Jquery</p>
  
  <pre><code>class Main
  {
       constructor()
       {
           this.updateProxy = $.proxy(this.update, this);
           requestAnimationFrame(this.updateProxy);  //fine    
       }
  
       updateProxy: () =&gt; void
       update(): void
       {
           requestAnimationFrame(this.updateProxy);  //fine
       }
  
  }
  </code></pre>
  
  <p>But coming from an Actionscript 3 background, I am not really sure what is happening here. Sorry I am not sure where Javascript begins and TypeScript ends.</p>
  
  <pre><code>updateProxy: () =&gt; void
  </code></pre>
  
  <p>And also, I am not convinced I am doing this right. The last thing I want is most of my class having a a() function which needs to be accessed with <code>aProxy()</code> as I feel I am writing the same thing twice? Is it normal?</p>