Scheduling for Animations

For fast visual updates such as canvas or DOM animations, we can either use the interval operator with a very low millisecond value or we can make a Scheduler that uses a function like setTimeout internally to schedule notifications.

But neither approach is ideal. In both of them we’re throwing all these updates at the browser, which may not be able to process them quickly enough. That happens because the browser is trying to render a frame and then it receives instructions to render the next one, so it drops the current frame to keep up the speed. The results are choppy animations. And we have enough of those on the web.

Browsers have a native way to handle animations, and they provide an API to use it called ...

Get Reactive Programming with RxJS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.