webtides / element-js

Simple and lightweight base classes for web components with a beautiful API
MIT License
26 stars 3 forks source link

Late Provider: Handle unfulfilled Context Requests to handle Issues with Load Time & late Element definition #87

Closed quarkus closed 1 year ago

quarkus commented 1 year ago

An idea wuld be to collect the requests on an global level and retrigger them at some time:

Lit does sth as well. https://github.com/lit/lit/tree/main/packages/labs/context

There is an issue in the protocol as well: https://github.com/webcomponents-cg/community-protocols/issues/25

Where do we place / ship the global logic for the pooling !?

EDIT:

Easiest way is probably to retrigger the requests here: https://github.com/webtides/element-js/blob/5ae7e17eac474c6cf58e881fd8e04fe845aba548/src/BaseElement.js#L327