[whatwg/dom] Proposal: MutationObserver.unobserve method to selectively stop observing a specific Node (#812)

I wanted to avoid dumping a wall of text, so I'm re-making #482 here in a concise new issue:

We currently have the `MutationObserver#observe(node, options)` method for selectively observing a certain `Node`, but we do not have a reciprocal `MutationObserver#unobserve(node, options)` method to selectively stop observing a specific `Node`.

At the moment, the `MutationObserver#disconnect()` method stops observing all `Node`s that a `MutationObserver` instance is observing, which can be useful, but isn't always what we want.

The main downside of having no `MutationObserver#unobserve` method is that we must then create one `MutationObserver` per `Node` for every `Node` that we may want to selectively stop observing, as opposed to having only a single `MutationObserver` for all said `Node`s.

The upside of having `MutationObserver#unobserve` would be that we could re-use a single `MutationObserver` on many nodes while having ability to clean up observation of specific `Node`s, which would reduce memory and CPU usage.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/812

Received on Saturday, 28 December 2019 02:13:29 UTC