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

withFields - on the "fields" field, add "id" field for better handling of lists #8

Open
adrians5j opened this issue May 26, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@adrians5j
Copy link
Member

adrians5j commented May 26, 2020

Currently, when you send data to a list of models (using fields field), the new data is just assigned and the old is lost.

This means that the data will always be marked as dirty, when in fact, only one field might have been changed. This prevents the users to do isDirty() checks completely.

By assigning IDs (a simple "id" field for every item), we can actually efficiently compare received data and current data in the field, and completely fix the problem explained above.

P.S. This should also tackle the following value: [] we needed to make here:

fields({ list: true, instanceOf: LockedFieldsModel, value: [] })
@adrians5j adrians5j added the bug Something isn't working label May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant