Re: [w3c/webcomponents] [feature request] change when upgrade/connected happens during parsing, so that it is the first event in the following microtask (#787)

>  @rniwa's approach is the correct one

Oh, so if we don't call `disconnect` on the observer, that's totally fine and it will be garbage collected later once we're done with the element? If so, it'd be nice if that was clear in the documentation that I can find for MutationObserver.

> for some reason tying them to connectedCallback and disconnectedCallback

Because in general I try to allocate memory (create references to new objects) when needed, then unallocate memory (lose references to those objects and call relevant cleanup methods) so that I am sure things clean up.

I have too much experience with devtools heap profiler to know that if I don't generally follow this pattern that I see things leak.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/787#issuecomment-459018401

Received on Wednesday, 30 January 2019 16:49:08 UTC