superfeedr / indexeddb-backbonejs-adapter

An indexedDB adapter for Backbonejs
http://blog.superfeedr.com/indexeddb-backbonejs-adapter/
MIT License
248 stars 61 forks source link

sync() should return a promise #24

Closed andornaut closed 11 years ago

andornaut commented 11 years ago

Fixes #23

Note that this adds an implicit dependency on jQuery.Deferred.

Existing tests pass, and this works in my own project, but I've not created new tests that exercise these changes.

julien51 commented 11 years ago

Hello. I am worried about the forced jquery requirement.

andornaut commented 11 years ago

I do agree that it's problematic.

The second commit adds a test for the presence of $.Deferred, which could be supplied by an alternate Deferred library such as Zepto+SimplyDeferred (https://github.com/sudhirj/simply-deferred).

if ($ && $.Deferred) {

If it's not there, then it works as before. It's not perfect, but it might be a reasonable compromise. Let me know if you have any other ideas.