短评 · ·

X 归档 2021-06-21

1 条动态 · 图 1 · 视频 0
TIL ResizeObserver & IntersectionObserver need to be manually disconnected, else they leak memory through their callback.

This happens in all browsers.

MutationObserver and event listeners don't have this issue.

Make sure you manually disconnect resize/intersection observers!
TIL:ResizeObserver 和 IntersectionObserver 需要手动 disconnect,否则它们会通过 callback 泄漏内存。

所有浏览器都有这个问题。

MutationObserver 和事件监听器没有这个问题。

记得手动断开 resize/intersection observer!
@jaffathecake 的配图 1/1