setInterval is to setTimeout as requestAnimationLoop is to requestAnimationFrame.
npm install request-animation-loop --save
Rotate an element for 1 second.
var deg = 0;var id =;;
Start an animation loop with function
callback which recieves a time in
milliseconds since last iteration as
id which is the id
of the loop.
Stop animation loop with id