-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
[BUG] arrayComputed does not recalculate after dependant array is set #5319
Comments
The recalculation of ArrayComputed doesn't have the same semantics as ComputedProperty. computed.filter and computed.sort schedule their recalculation on the run loop. Your example will work if you put the |
@mmun do you think we can fix this? or should we just close? |
@mmun ping. |
@ef4 do you have any thoughts on this matter? |
This behavior is definitely undesirable. Ideally we would separate the invalidation step from the recomputation step. That's how scalar computed properties work. |
…rjs#9462, emberjs#4919, emberjs#4231, emberjs#3706, emberjs#5596, emberjs#9485, emberjs#9492, emberjs#5319, emberjs#5268, emberjs#4831, emberjs#5558] Move away from AC/RC instead use the simpler naive enumerable methods, and rely on glimmers stable rendering for efficiency. For more complex scenarios, custom solutions should be used. @wagenet & @stefanpenner
Here is a failing test case: http://jsbin.com/dohavimi/1/edit?html,js,console
Basically,
computed.filterBy
orcomputed.filter
fails to recompute synchronously after its dependant array is set. An explicitly defined computed property works, so it looks like an arrayComputed issue. It works if their values are not cached (if you remove the prior gets). It also works if I usepushObjects
instead ofset
.Am I wrong to assume the computed properties should recalculate synchronously before the final gets?
The text was updated successfully, but these errors were encountered: