implemented cache fixed #89
This commit is contained in:
parent
448cb24ca3
commit
fff75df0df
8 changed files with 119 additions and 84 deletions
|
@ -16,13 +16,13 @@ function() {
|
|||
};
|
||||
|
||||
CacheStorage.prototype.getItem = function(key) {
|
||||
return localStorage.getItem(this.mkPath(key));
|
||||
return JSON.parse(localStorage.getItem(this.mkPath(key)));
|
||||
}
|
||||
|
||||
CacheStorage.prototype.setItem = function(key, value) {
|
||||
var item = this.getItem(key);
|
||||
|
||||
localStorage.setItem(this.mkPath(key), value);
|
||||
localStorage.setItem(this.mkPath(key), JSON.stringify(value));
|
||||
|
||||
if (!item) {
|
||||
var length_path = this.mkInternalPath("_length");
|
||||
|
|
Reference in a new issue