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

model.fetch.then #3779

Closed
wants to merge 2 commits into from
Closed

model.fetch.then #3779

wants to merge 2 commits into from

Conversation

godlark
Copy link

@godlark godlark commented Aug 27, 2015

Recently I've made code similiar to:

book.fetch().then(function(resp) {
});

And I've expected to get a parsed response with my 'Book.parse' function but I've got a raw response.

@akre54
Copy link
Collaborator

akre54 commented Aug 27, 2015

Closing in favor of #3729 and #3651. Please do a search before opening issues.

@akre54 akre54 closed this Aug 27, 2015
@godlark
Copy link
Author

godlark commented Aug 28, 2015

Have you read the issue before closing? My pull request complain about how fetch function works. I DO NOT complain about using jquery.Deffered etc. And my change: only few lines and some changes in tests - there is no a BIG refactor.

@akre54
Copy link
Collaborator

akre54 commented Aug 28, 2015

Backbone.sync proxies to Backbone.ajax behind the scenes. The then function you're getting from the return value of fetch is simply the return value from jQuery.ajax, a jqxhr (xhr wrapped in jQuery.Deferred.)

Backbone has no use for Promises at the moment. We don't even guarantee that the fetch function will return a thenable (i.e. a function with a then method) as your change requires, therefore we can't add add this change until we make some major plumbing decisions like the ones in #3729 and #3651. If you want this change, stop by those issues and register your input, they might have already added it.

@godlark
Copy link
Author

godlark commented Aug 28, 2015

Ok, thanks for the reply :)

This was referenced Aug 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants