Closed andornaut closed 11 years ago
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 #19https://github.com/superfeedr/indexeddb-backbonejs-adapter/issues/19 .
Unfortunately Zepto doesn't provide an implementation of Deferred, but hopefully it'll be added soon:
madrobby/zepto#353 https://github.com/madrobby/zepto/issues/353
— Reply to this email directly or view it on GitHubhttps://github.com/superfeedr/indexeddb-backbonejs-adapter/issues/23.
Done #24
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:
https://github.com/madrobby/zepto/issues/353