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

Backbone 1.0 and Backbone 0.9.10 compatibility difference #46

Open
rtxanson opened this issue Jul 14, 2013 · 0 comments
Open

Backbone 1.0 and Backbone 0.9.10 compatibility difference #46

rtxanson opened this issue Jul 14, 2013 · 0 comments

Comments

@rtxanson
Copy link

While trying out Backbone.Offline with Backbone 1.0, I uncovered one of the differences. It's nearing the end of the day here, so I won't try to fix and submit a pull request myself, but I thought I'd at least document what I found.

Between 0.9.10 and 1.0, Backbone reverted the API for Backbone.sync success and error callbacks: jashkenas/backbone@6e646f1ba

This this means that with Backbone 1.0, when you run collection.storage.sync.pull(), you get an error such as:

caught TypeError: Cannot use 'in' operator to search for '0' in success 

The problem here of course, is that response ends up being a string "success", not an array of models as the code expects. Unfortunate, because this adds a level of complexity for trying to support both 0.9.10, and 1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant