4 ms·
I would at least be careful using Redux to push realtime animation state changes. Returning a fresh application state every 16.6 milliseconds means a lot of obj
by matthewtoast 11y ago
I would at least be careful using Redux to push realtime animation state changes. Returning a fresh application state every 16.6 milliseconds means a lot of object allocations, which means garbage collection, which means UI freezes turning your smooth animation design into an unpleasant experience.
There may be a general solution for this out there, or at least an approach that makes it workable for some cases, but I haven't come across it yet. And of course it really depends on how demanding your performance needs are. You might be able to get away with using Redux for animations despite the above.
It would be great to see something like Redux that gives you debugging precision all the way down to the animation frame, but which avoids the garbage problem.
- iamwil 11y agoThat shouldn't be a problem if you're using an immutable store for your application state. As I understand it, immutable stores are logically a completely different object, but under the hood, it reuses the elements so you're not creating objects all the time.