-
Notifications
You must be signed in to change notification settings - Fork 72
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
Why listen to change
event on collection?
#96
Comments
Or even the |
@mir3z I've been off Backbone development for quite a while, but I think the Actually we're already listening to the |
I understand your point but let's consider the following use case. Let's have a collection of of TODOs. Then we create a React component which represents a list of TODOs. This component uses a collection as a data source. The list consists of specific TODO items. Each item is another React component and has TODO model as a data source. Now let's assume a model changes. It triggers My point is that Your approach is fine as long you work with small collection collections and models. But it does not scale well if collection has 1000 or more heavy models. Of course implementing #79 may be a cure for my concerns. |
I totally agree with you and that's also the best way of binding your data sources. Feel free to PR this as well, I'll release a new minor afterwards. I think tests will need some changes to accommodate this. #79 might take some time or may never be coded, at least by me :) |
Unfortunately I don't have enough time to implement this change. It seems to be rather a massive change. |
I don't think this is that massive change but I'll try to tackle this when I find sometime. Though I'm not sure if I'll have anytime soon |
What's the reason behind listening to
change
event on collections? This causes a lot of events which leads to re-rendering components. Wouldn't be better to listen toadd
andremove
events?The text was updated successfully, but these errors were encountered: