angular-http-cache
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "angular-http-cache", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "An angular module that sits on top of $http and adds caching support and application wide notifications when cached data is updated.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,3 +9,3 @@ 'use strict'; | ||
/** | ||
* @param {object} object | ||
* @param {Object} object | ||
* @param {string} object.collection | ||
@@ -26,3 +26,3 @@ * @param {boolean} object.caching | ||
this.setDomain(options.domain); | ||
} | ||
}; | ||
@@ -43,5 +43,3 @@ /** | ||
var cached = $localDb.getIndex(this._getCacheKey(), id); | ||
if (cached && !params.ignoreCache) { | ||
resolve(cached); | ||
} | ||
if (cached && !params.ignoreCache) { resolve(cached);} | ||
@@ -61,3 +59,3 @@ $http({method: 'GET', url: '/' + this._getUrlPredicate() + '/' + id}) | ||
}).bind(this)) | ||
} | ||
}; | ||
@@ -102,3 +100,3 @@ /** | ||
}).bind(this)) | ||
} | ||
}; | ||
@@ -110,3 +108,3 @@ /** | ||
*/ | ||
httpCache.prototype.create = function (data, callback) { | ||
httpCache.prototype.create = function (data) { | ||
return $q((function (resolve, reject) { | ||
@@ -126,3 +124,3 @@ | ||
}).bind(this)) | ||
} | ||
}; | ||
@@ -134,3 +132,3 @@ /** | ||
*/ | ||
httpCache.prototype.update = function (doc, callback) { | ||
httpCache.prototype.update = function (doc) { | ||
return $q((function (resolve, reject) { | ||
@@ -149,3 +147,3 @@ delete doc.$$hashKey; | ||
}).bind(this)) | ||
} | ||
}; | ||
@@ -159,3 +157,3 @@ /** | ||
*/ | ||
httpCache.prototype.patch = function (id, prop, value, callback) { | ||
httpCache.prototype.patch = function (id, prop, value) { | ||
return $q((function (resolve, reject) { | ||
@@ -175,3 +173,3 @@ | ||
}).bind(this)) | ||
} | ||
}; | ||
@@ -183,3 +181,3 @@ /** | ||
*/ | ||
httpCache.prototype.delete = function (id, callback) { | ||
httpCache.prototype.delete = function (id) { | ||
return $q((function (resolve, reject) { | ||
@@ -199,3 +197,3 @@ | ||
}).bind(this)) | ||
} | ||
}; | ||
@@ -207,3 +205,3 @@ /** | ||
this._indexMap = {}; | ||
} | ||
}; | ||
@@ -216,3 +214,3 @@ /** | ||
this._collection = collection; | ||
} | ||
}; | ||
@@ -224,3 +222,3 @@ /** | ||
return this._collection; | ||
} | ||
}; | ||
@@ -233,3 +231,3 @@ /** | ||
this._caching = caching; | ||
} | ||
}; | ||
@@ -241,3 +239,3 @@ /** | ||
return this._caching; | ||
} | ||
}; | ||
@@ -250,3 +248,3 @@ /** | ||
this._domain = domain; | ||
} | ||
}; | ||
@@ -258,3 +256,3 @@ /** | ||
return this._domain; | ||
} | ||
}; | ||
@@ -269,3 +267,3 @@ /** | ||
this._domain = ''; | ||
} | ||
}; | ||
@@ -277,3 +275,3 @@ /** | ||
return this._domain ? this._domain + '/' + this._collection : this._collection; | ||
} | ||
}; | ||
@@ -285,3 +283,3 @@ /** | ||
return this._domain ? this._domain + ':' + this._collection : this._collection; | ||
} | ||
}; | ||
@@ -293,3 +291,3 @@ /** | ||
return this._domain ? this._domain + '-' + this._collection : this._collection; | ||
} | ||
}; | ||
@@ -305,3 +303,6 @@ /** | ||
if (index) { | ||
if (secondary && index) { | ||
if (this._indexMap[index].indexOf(secondary) == -1) { this._indexMap[index].push(secondary); } | ||
$localDb.addToSecondaryIndexSet(this._getCacheKey(), index, secondary, doc); | ||
} else if (index) { | ||
this._indexMap[index] = this._indexMap[index] || []; | ||
@@ -311,7 +312,3 @@ $localDb.addToIndexSet(this._getCacheKey(), index, doc); | ||
if (secondary) { | ||
if (this._indexMap[index].indexOf(secondary) == -1) { this._indexMap[index].push(secondary); } | ||
$localDb.addToSecondaryIndexSet(this._getCacheKey(), index, secondary, doc); | ||
} | ||
} | ||
}; | ||
@@ -338,3 +335,3 @@ /** | ||
} | ||
} | ||
}; | ||
@@ -388,7 +385,6 @@ /** | ||
} | ||
}; | ||
return httpCache; | ||
}]) | ||
}]); |
{ | ||
"name": "angular-http-cache", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "An angular module that sits on top of $http and adds caching support and application wide notifications when cached data is updated. ", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
16205
407