A zero-config, drop-in animation utility that adds smooth transitions to your web app. You can use it with React, Vue, or any other JavaScript application.
It is observed that this function is called every time the songs.value is set
the forEach will setTimeout on every el children, and doesn't clearTimeout, which will create thousands of thousands closure and callbacks, and leads to memory leak.
This replacement of array is common in vue design.
So, in theory, any update frequency less than 2s will cause the memory go insane eventually. In fact the intervals is never get clearInterval either, so that is another leak point.
In conclusion, auto-animate doesn't work with changing items (for a long runtime)
Assume this template:
In javascript, this triggers every second.
It is observed that this function is called every time the songs.value is set![image](https://github.com/formkit/auto-animate/assets/29846655/e4dde81e-47c3-4357-ac7c-783bc2703406)
the![image](https://github.com/formkit/auto-animate/assets/29846655/c57f8ec6-dc47-423e-9241-5267e67e24ac)
forEach
will setTimeout on everyel
children, and doesn't clearTimeout, which will create thousands of thousands closure and callbacks, and leads to memory leak.This replacement of array is common in vue design.![image](https://github.com/formkit/auto-animate/assets/29846655/8307020e-a53a-4ed9-a402-88347cf33723)
So, in theory, any update frequency less than 2s will cause the memory go insane eventually. In fact the
intervals
is never get clearInterval either, so that is another leak point.In conclusion, auto-animate doesn't work with changing items (for a long runtime)