jeromegn/Backbone.localStorage

underscore.js

Closed this issue · 1 comments

Congratulation for the job that has been done for such backbone plugin: simple & efficient-that's all I can tell.
I needed to create a sort of cache (<=> usage of Backbone.LocalStorage) that invalidates itself after a given expiration specified in minutes/hours. So I reviewed your code to see how you did the switch between localSync and ajaxSync, and I was wondering why you didn't get a reference of underscore.js, that library has exactly the same methods you used in your code (isObject, extend, result & contains). As Backbone.js has already a (strong) dependency for underscore.js, it sounds for me very weird that you didn't get the same reference.
doing so, you can also create an underscore mixin to consider the creation of a guid (named as "newGuid") and that would be available for those who want to... so this issue is not really an issue, rather a question that may raise a change.

Thanks @zobidafly for your suggestion. I'm working on a version that will be doing exactly this.

Regards, Scott