Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider newValue / oldValue for Store propertyWatcher ? #108

Open
quarkus opened this issue Feb 5, 2024 · 0 comments
Open

Consider newValue / oldValue for Store propertyWatcher ? #108

quarkus opened this issue Feb 5, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request v1.0.0

Comments

@quarkus
Copy link
Contributor

quarkus commented Feb 5, 2024

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

@quarkus quarkus self-assigned this Feb 5, 2024
@quarkus quarkus added enhancement New feature or request v1.0.0 labels Feb 5, 2024
quarkus added a commit that referenced this issue Mar 14, 2024
…obervers with new and old values just like element properties would do
quarkus added a commit that referenced this issue Mar 14, 2024
quarkus added a commit that referenced this issue Mar 14, 2024
currently breaks due to structured cloning.
We might need to rely on more naiive serializaition (parse/stringify) or pass references ..
quarkus added a commit that referenced this issue Mar 19, 2024
…s are happy

structured cloning did not work if eg html elements were referenced by the clone (quite likely with storecetpions as they keep track of the observers)
quarkus added a commit that referenced this issue Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v1.0.0
Projects
None yet
Development

No branches or pull requests

1 participant