[w3c/webcomponents] How to avoid memory leaks when detecting custom elements? (#674)

For example,

```js
            if (elementName.includes('-')) {
                customElements.whenDefined(elementName).then(() => {
                    console.log('          --- element defined:', elementName)
                })
            }
```

I don't know if an element will be a custom element, but in order to try to detect this, it seems that I will leak memory due to promises that are never resolved. I don't know the names of the custom elements either, they are arbitrarily defined and can be different for every app.

-- 
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/674

Received on Sunday, 8 October 2017 06:29:36 UTC