Рет қаралды 31,538
There is a great method called window.requestAnimationFrame which lets you work with the natural rhythm of the browser to improve your UI updates and animations. It will let you call a function each time it is about to do a screen paint and update the interface.
Inspiration for this video: gomakethings.com/how-to-use-r...
Code from video: gist.github.com/prof3ssorSt3v...
MDN reference for requestAnimationFrame: developer.mozilla.org/en-US/d...