webtides / element-js

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

Update Pooling in Stores !? #91

Open quarkus opened 1 year ago

quarkus commented 1 year ago

May be it makes sense to pool Updates in Stores just like we do in the Base Element. Maybe this is not needed once we can have Store in Stores ..

eddyloewen commented 1 year ago

I think it makes sense to also add the pooling for stores. The main reason to have the pooling was to reduce the number of updates/renders. If we now start moving properties and logic to stores - they will call the "requestUpdate" more often than before because it is not pooled.

quarkus commented 10 months ago

but the updates are pooled in the elements anyways ;)

eddyloewen commented 4 months ago

@quarkus not if the updates are comming from the same property. Pooling works across multiple properties on the element. The store is only one property on the element. When the store has multiple properties as well and those are not pooled (in the store) multiple changes inside the store will trigger mutliple upldates on the element.