Re: [w3c/webcomponents] Non-class based example of customElement.define() (#587)

@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