formkit / auto-animate

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.
https://auto-animate.formkit.com
MIT License
11.96k stars 210 forks source link

feat: destroy, unmount #198

Open pyongchen opened 3 months ago

pyongchen commented 3 months ago

When the animation-mounted component is destroyed, the corresponding variables such as parents, mutations, resize, and timers are not cleared, which will cause memory leaks. Therefore, add a destroy method to autoAnimate, which is called when the component is destroyed. Memory leak related information is as follows: 企业微信截图_17100756826683 企业微信截图_1710075805294 Memory keeps rising as page routing switches

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auto-animate ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 10, 2024 1:09pm
justin-schroeder commented 1 month ago

@pyongchen did you want to make the changes shown in the review?