Re: [w3c/webcomponents] Some sort of guarantee on custom element lifecycle order of events (#737)

You [said that](https://github.com/w3c/webcomponents/issues/558#issuecomment-361034595)

> whenDefined() only works when the library author knows the names that library constructors will be assigned to

Given that constructors can only be used in a custom element registry once (effectively making the registry a Bi-Map), would it work for your use cases to have a method like `.whenRegistered(CustomElementConstructor)` that is resolved to the custom element name its associated with?

Then you could just use it like this:

```js
class ElementOne extends HTMLElement {
    async connectedCallback() {
        await customElements.whenRegistered(ElementTwo)
    }
}
```

-- 
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/737#issuecomment-366497698

Received on Sunday, 18 February 2018 07:26:18 UTC