DEV Community

Discussion on: How to process heavy workloads AND animate at 60fps in Vanilla JS, any Framework or React Native:

Collapse
 
miketalbot profile image
Mike Talbot ⭐

So the animations use requestAnimationFrame - the key thing being to use generators to create imperative for next loops in that case.

The processing stuff uses requestIdleCallback. I polyfill that in a variety of ways.

The problem with other threads is the effort of moving things to and from them, so if the animation was basically a ton of processing that resulted in something simple and small enough to move then it would work. I'm thinking some kind of complex particle simulation or 3d work.