- From: Glenn Maynard <glenn@zewt.org>
- Date: Sat, 2 Mar 2013 08:15:03 -0600
- To: David Bruant <bruant.d@gmail.com>
- Cc: Webapps WG <public-webapps@w3.org>
Received on Saturday, 2 March 2013 14:15:30 UTC
On Sat, Mar 2, 2013 at 5:03 AM, David Bruant <bruant.d@gmail.com> wrote:
> If someone wants to reuse the same function for requestionAnimationFrame,
> he/she has to go through:
> requestAnimationFrame(function f(){
> requestAnimationFrame(f);
> // do stuff
> })
>
FYI, this pattern is cleaner, so you only have to call
requestAnimationFrame in one place:
function draw() {
// render
requestAnimationFrame(draw);
}
draw();
--
Glenn Maynard
Received on Saturday, 2 March 2013 14:15:30 UTC