webtides / element-js

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

Storeception: Stores as properties in Stores #90

Closed quarkus closed 1 year ago

quarkus commented 1 year ago

It might be usefull to have Store instances within Stores.

Wrapping Stores should probably become observer of the nested Store ..

eddyloewen commented 1 year ago

I actually thought that this is already be possible 🤷‍♂️ . I must really start looking more carefully through the PRs 😆 But yeah! This can be a really nice thing as this will allow us to build truly reactive nested "objects"

quarkus commented 1 year ago

Haha .. @eddyloewen take a look the Draft MR i opened . It's not really complicated but we have to aggree on what a nested update should actually do.

requestUpdate (-> notify all observer by default ) && call watchers or simply call the watchers and leave the update decision to the observer.

quarkus commented 1 year ago

@eddyloewen i think the feature works and tests are happy. would be great if you could take a look at it again.