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

Object-type attributes will always be dirty no matter if they are modified or not #56

Open
limbov8 opened this issue Dec 6, 2019 · 0 comments

Comments

@limbov8
Copy link

limbov8 commented Dec 6, 2019

Hi, when I try to update a model, it will send all object attributes to server which is not really ideal since sometimes objects are huge and donot meant to be updated.

Found this line of code here:

} else if (prior !== current) {

Update to JSON.stringify(prior) !== JSON.stringify(current) would solve the problem.

Also, this similar issue here:

if (self[k] !== attrs[k] && !changes[k]) {

Inside self[k] !== attrs[k] && !changes[k], if an attribute is an object, self[k] !== attrs[k] might always return true and !changes[k] will always return false. So, model.ts#L480 will never happen.

@limbov8 limbov8 changed the title Object Type attributes will always be dirty no matter it modified or not Object-type attributes will always be dirty no matter if they are modified or not Dec 6, 2019
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

No branches or pull requests

1 participant