We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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.indexdb.sync should maintain the same interface as Backbone.sync by returning a Deferred Promise object.
Backbone.indexdb.sync
Backbone.sync
Backbone's sync() returns the xhr object from JQuery's ajax():
sync()
ajax()
Backbone.sync = function(method, model, options) { //... var xhr = Backbone.ajax(_.extend(params, options)); model.trigger('request', model, xhr, options); return xhr; }
Backbone.ajax = function() { return Backbone.$.ajax.apply(Backbone.$, arguments); };
This would also provide a workaround for people looking for synchronous behaviour such as in this other ticket #19.
Unfortunately Zepto doesn't provide an implementation of Deferred, but hopefully it'll be added soon:
madrobby/zepto#353
The text was updated successfully, but these errors were encountered:
Please submit a patch. On Dec 16, 2012 1:06 PM, "andornaut" notifications@github.com wrote:
Backbone.indexdb.sync should maintain the same interface as Backbone.syncby returning a Deferred Promise object. Backbone's sync() returns the xhr object from JQuery's ajax(): Backbone.sync = function(method, model, options) { //... var xhr = Backbone.ajax(_.extend(params, options)); model.trigger('request', model, xhr, options); return xhr; } Backbone.ajax = function() { return Backbone.$.ajax.apply(Backbone.$, arguments); }; This would also provide a workaround for people looking for synchronous behaviour such as in this other ticket #19#19 . Unfortunately Zepto doesn't provide an implementation of Deferred, but hopefully it'll be added soon: madrobby/zepto#353 madrobby/zepto#353 — Reply to this email directly or view it on GitHubhttps://github.com//issues/23.
Backbone.indexdb.sync should maintain the same interface as Backbone.syncby returning a Deferred Promise object.
Backbone.sync = function(method, model, options) { //...
var xhr = Backbone.ajax(_.extend(params, options)); model.trigger('request', model, xhr, options); return xhr;
}
This would also provide a workaround for people looking for synchronous behaviour such as in this other ticket #19#19 .
madrobby/zepto#353 madrobby/zepto#353
— Reply to this email directly or view it on GitHubhttps://github.com//issues/23.
Sorry, something went wrong.
Done #24
9811b61
Successfully merging a pull request may close this issue.
Backbone.indexdb.sync
should maintain the same interface asBackbone.sync
by returning a Deferred Promise object.Backbone's
sync()
returns the xhr object from JQuery'sajax()
:This would also provide a workaround for people looking for synchronous behaviour such as in this other ticket #19.
Unfortunately Zepto doesn't provide an implementation of Deferred, but hopefully it'll be added soon:
madrobby/zepto#353
The text was updated successfully, but these errors were encountered: