Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi all,
We've been leveraging the Deferred objects returned from Backbone.sync calls extensively in our application, and have found those to be very convenient, particularly when views depend on multiple models.
One case we've struggled with is when we have nested Backbone views, we're forced to provide both the collection instance and deferred object to the child view constructor:
The example above is fairly trivial, but quickly becomes complex has the hierarchy grows (particularly if certain views in the hierarchy should not be blocked from rendering based on data not being ready). It would be nice if the deferred would be modified slightly such that the collection (or model) was provided as the first argument to the callbacks:
I've attached a pull request to this issue illustrating a potential fix, but am certainly open to suggestions and other approaches to take.
Thanks,
Phil