victorquinn/Backbone.CrossDomain — pull request #12 by christhomson (2014-10-02 23:29:57+00:00)
Title: Resolve after the success callback, to play nice with fetch.

Hey there!

We had something like `@collection.fetch().then => …` and it was not working correctly because `fetch()` would resolve its deferred object (and call the function passed to `then`) before actually updating the model that was fetched. Inside the function passed to `then`, we were trying to access some of the data that `fetch` would've fetched, but it wasn't there yet because the `success` callback was not called.

Backbone updates the model in the `success` callback [here](https://github.com/jashkenas/backbone/blob/743ebb788d8909b277ca459c6c9159f9528b6f87/backbone.js#L451-L455).

I can provide a more in-depth example if desired.

Thanks!