webtides / element-js

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

Consider newValue / oldValue for Store propertyWatcher ? #108

Open quarkus opened 7 months ago

quarkus commented 7 months ago

NEW / OLD VALUE

Revisit this line: src/util/Store.js:94 observer.callPropertyWatcher(key, this, this);

Consider cloning the state before update and: observer.callPropertyWatcher(key, this._state, oldState);

The instance should be available in the views anyways ..

property watchers

it migh also make sense to just watch certain properties