Re: [WICG/webcomponents] Lazy Custom Element Definitions (#782)

> @uasan Seems like that solution could create some challenges around determining whether a double define of the same element is happening. Does it also open up the possibility of race conditions?

the `customElements.lazyDefine` method should only call the load function once, but if the promise reject (example client offline), then perhaps a delayed callback mechanism is needed

```JS
customElements.lazyDefine('my-element', async () => {
 const { MyElement } =  await import('my-element');
  customElements.define('my-element', MyElement, ... );
}, { retry: { delay: 5000 } } );
```

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

Message ID: <WICG/webcomponents/issues/782/1523808801@github.com>

Received on Wednesday, 26 April 2023 17:38:00 UTC