-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Feature request] Run computed properties in dependency order #5143
Closed
kevinpschaaf opened this issue
Mar 9, 2018
· 3 comments
· May be fixed by 137717unity/wpt.fyi#4, eroself/vaadin-litelement-datebook#2, eroself/vaadin-litelement-datebook#3, eroself/vaadin-litelement-datebook#4 or eroself/vaadin-litelement-datebook#5
Closed
[Feature request] Run computed properties in dependency order #5143
kevinpschaaf opened this issue
Mar 9, 2018
· 3 comments
· May be fixed by 137717unity/wpt.fyi#4, eroself/vaadin-litelement-datebook#2, eroself/vaadin-litelement-datebook#3, eroself/vaadin-litelement-datebook#4 or eroself/vaadin-litelement-datebook#5
Labels
Comments
Proof-of-concept mixin that recurses to run computed dependencies of a computed proeprty first: https://jsbin.com/dewewah/edit?html,console |
kevinpschaaf
added a commit
that referenced
this issue
Mar 9, 2018
kevinpschaaf
added a commit
that referenced
this issue
Apr 13, 2019
[3.x] Evaluated computed property dependencies first. Fixes #5143
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Stale? Isn't it fixed already? |
This was referenced Sep 7, 2024
This was referenced Sep 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Currently computed properties with invalidated dependencies are re-computed based on a combination of order they exist in the
properties
block and the order that dependencies are set, and will continue re-computing if subsequent dependent properties change. This can result in computed properties running more than once in a turn, which is both inefficient if the computed property has expensive computation/side-effects, and may violate user expectation.Live Demo
https://jsbin.com/lofapu/1/edit?html,console
Expected Results
Note that
computeZ
is run twice for the same change tox
Actual Results
Ideally
computeZ
would only be run onceBrowsers Affected
All
Versions
The text was updated successfully, but these errors were encountered: