webtides / element-js

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

Fix/watcher for injected only properties #89

Closed quarkus closed 1 year ago

quarkus commented 1 year ago

fix(store-injection-watcher): fix a bug where watchers were not triggered as the lookup in properties() was wrong.

Stores can also be injected and will never show up in the return of the properties map rather than in the injectProperties map. It`s way easier to directly check if the changed Store instance is in the observers state as this is where the values actually live.

Also removes the attempt to provide new/old Store Values to the watch Callbacks as this was changing the model passed to the callback between store to property assignment (injection OR direct) and internal changes.