- From: Andreas <notifications@github.com>
- Date: Sat, 08 Dec 2018 10:23:06 -0800
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Saturday, 8 December 2018 18:23:28 UTC
@trusktr
To help you ignore order you should always construct you elements as soon as they resolve by using [`customElements.whenDefined(name);`](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/whenDefined):
```js
const ES5Element = function() {}
customElements.whenDefined('es5-element').then(function() {
Reflect.construct(HTMLElement, [], ES5Element) // will never depend upon order
});
customElements.define('es5-element', ES5Element)
```
--
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/587#issuecomment-445479377
Received on Saturday, 8 December 2018 18:23:28 UTC