Helper for
requestAnimationFrame
$ npm install --save speedr/raf
var raf = require('raf');
var id = raf.start(function(elapsed) {
// Called every frames
game.update(elapsed);
});
Calls fn
on every frame with elapsed
set to the elapsed time in milliseconds.
Returns the request ID.
Cancels the specified animation frame request.
MIT © Florent Cailhol