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

Collection must know its changes made during the last transaction #136

Open
gaperton opened this issue Feb 18, 2016 · 1 comment
Open

Collection must know its changes made during the last transaction #136

gaperton opened this issue Feb 18, 2016 · 1 comment

Comments

@gaperton
Copy link

Model knows it, so why collection shouldn't?

collection.changed - array of changed models.
collection.added - same for added models
collection.removed - same for removed models.

This feature will allow complete inspection of the last transaction made on models tree, making it possible to generate changes feed. Which will open the way to implement live data sync with server, because last transaction tree becomes completely traversable.

@gaperton
Copy link
Author

added and removed - that's easy. Problem is to track changed models... Easiest way of doing this is to maintain changed hash, which is filled in on model's change event. Easiest and slowest one.

For reset it's not a problem, though. For set, it probably won't add a lot of overhead, considering all other things which are being done during the deep change... In most cases there won't be any duplicates, so we may use array, instead of hash.

So, we go with arrays.

@gaperton gaperton added the idea label Feb 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant