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

store.update forces an array CP to recalculate #2450

Closed
samselikoff opened this issue Nov 3, 2014 · 2 comments · Fixed by #2460
Closed

store.update forces an array CP to recalculate #2450

samselikoff opened this issue Nov 3, 2014 · 2 comments · Fixed by #2460

Comments

@samselikoff
Copy link
Contributor

I'm using store.update to update a particular property, but a CP which doesn't rely on that property is being recalculated.

I have a jsbin illustrating the problem:

http://emberjs.jsbin.com/loseda/5/edit?html,js,output

I would expect the Computed Property list to rerender only the parts that have changed (similar to the controller example), but the entire list is being rerendered. You can verify this by adding some state to the input fields; notice they get cleared in the CP example, but not the controller example.

@wecc
Copy link
Contributor

wecc commented Nov 4, 2014

Related: emberjs/ember.js#4423

@wecc
Copy link
Contributor

wecc commented Nov 4, 2014

So yeah, DS.Model attributes are Computed Properties listening on 'data', and pushing to the store (full or partial) triggers record.notifyPropertyChange('data'); which makes all attribute CPs trigger and in this scenario makes your CP/filterBy based on isActive trigger too.

I'd love to work some more on this and I've got a proof-of-concept working locally with some modifications not suited for production, I need some guidance on how to proceed. cc @igorT @stefanpenner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants