-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Stable Version 3.1.0.
- Loading branch information
Showing
9 changed files
with
135 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,11 +33,12 @@ module.exports = function (grunt) { | |
options: { | ||
report: 'min', | ||
sourceMap: true, | ||
sourceMapName: 'dist/angular-cache.min.map', | ||
banner: '/**\n' + | ||
'* @author Jason Dobry <[email protected]>\n' + | ||
'* @file angular-cache.min.js\n' + | ||
'* @version <%= pkg.version %> - Homepage <https://github.com/jmdobry/angular-cache>\n' + | ||
'* @copyright (c) 2013 Jason Dobry <http://www.pseudobry.com>\n' + | ||
'* @copyright (c) 2013-2014 Jason Dobry <http://www.pseudobry.com>\n' + | ||
'* @license MIT <https://github.com/jmdobry/angular-cache/blob/master/LICENSE>\n' + | ||
'*\n' + | ||
'* @overview angular-cache is a very useful replacement for Angular\'s $cacheFactory.\n' + | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/** | ||
* @author Jason Dobry <[email protected]> | ||
* @file angular-cache.js | ||
* @version 3.0.3 - Homepage <https://github.com/jmdobry/angular-cache> | ||
* @copyright (c) 2013 Jason Dobry <http://www.pseudobry.com> | ||
* @version 3.1.0 - Homepage <https://github.com/jmdobry/angular-cache> | ||
* @copyright (c) 2013-2014 Jason Dobry <http://www.pseudobry.com> | ||
* @license MIT <https://github.com/jmdobry/angular-cache/blob/master/LICENSE> | ||
* | ||
* @overview angular-cache is a very useful replacement for Angular's $cacheFactory. | ||
|
@@ -852,7 +852,7 @@ DSCache.prototype.touch = function (key) { | |
|
||
module.exports = DSCache; | ||
|
||
},{"../DSBinaryHeap":1,"../defaults":"XjryW+","./destroy":2,"./get":3,"./info":5,"./keySet":6,"./keys":7,"./put":8,"./remove":9,"./removeAll":10,"./removeExpired":11,"./setCacheFlushInterval":12,"./setCapacity":13,"./setDeleteOnExpire":14,"./setMaxAge":15,"./setOnExpire":16,"./setRecycleFreq":17}],5:[function(require,module,exports){ | ||
},{"../DSBinaryHeap":1,"../defaults":"kH9dpy","./destroy":2,"./get":3,"./info":5,"./keySet":6,"./keys":7,"./put":8,"./remove":9,"./removeAll":10,"./removeExpired":11,"./setCacheFlushInterval":12,"./setCapacity":13,"./setDeleteOnExpire":14,"./setMaxAge":15,"./setOnExpire":16,"./setRecycleFreq":17}],5:[function(require,module,exports){ | ||
/** | ||
* @doc method | ||
* @id DSCache.methods:info | ||
|
@@ -1717,7 +1717,7 @@ module.exports = function setRecycleFreq(recycleFreq) { | |
},{}],18:[function(require,module,exports){ | ||
var defaults = require('../defaults'), | ||
DSCache = require('../DSCache'), | ||
version = '3.0.3'; | ||
version = '3.1.0'; | ||
|
||
/** | ||
* @doc function | ||
|
@@ -1773,6 +1773,21 @@ function DSCacheFactoryProvider() { | |
return keys; | ||
} | ||
|
||
function createCache(cacheId, options) { | ||
if (cacheId in caches) { | ||
throw angular.$$minErr('$cacheFactory')('iid', "CacheId '{0}' is already taken!", cacheId); | ||
} else if (!angular.isString(cacheId)) { | ||
throw angular.$$minErr('ng')('areq', 'Expected cacheId to be a string! Found: {0}.', typeof cacheId); | ||
} | ||
|
||
caches[cacheId] = new DSCache(cacheId, angular.extend({}, config, options)); | ||
caches[cacheId].destroy = function () { | ||
this.constructor.prototype.destroy.call(this); | ||
delete caches[this.$$id]; | ||
}; | ||
return caches[cacheId]; | ||
} | ||
|
||
/** | ||
* @doc function | ||
* @id DSCacheFactory | ||
|
@@ -1798,20 +1813,35 @@ function DSCacheFactoryProvider() { | |
* @returns {DSCache} New instance of DSCache. | ||
*/ | ||
function DSCacheFactory(cacheId, options) { | ||
if (cacheId in caches) { | ||
throw angular.$$minErr('$cacheFactory')('iid', "CacheId '{0}' is already taken!", cacheId); | ||
} else if (!angular.isString(cacheId)) { | ||
throw angular.$$minErr('ng')('areq', 'Expected cacheId to be a string! Found: {0}.', typeof cacheId); | ||
} | ||
|
||
caches[cacheId] = new DSCache(cacheId, angular.extend({}, config, options)); | ||
caches[cacheId].destroy = function () { | ||
this.constructor.prototype.destroy.call(this); | ||
delete caches[this.$$id]; | ||
}; | ||
return caches[cacheId]; | ||
return createCache(cacheId, options); | ||
} | ||
|
||
/** | ||
* @doc method | ||
* @id DSCacheFactory.methods:createCache | ||
* @name createCache | ||
* @description | ||
* Factory function that produces instances of `DSCache`. | ||
* | ||
* @param {string} cacheId The id of the new cache. | ||
* @param {object} options Configuration options. Properties: | ||
* | ||
* - `{number=}` - `capacity` - Default: `Number.MAX_VALUE` | ||
* - `{number=}` - `maxAge` - Default: `null` | ||
* - `{number=}` - `deleteOnExpire` - Default: `none` | ||
* - `{function=}` - `onExpire` - Default: `null` | ||
* - `{number=}` - `cacheFlushInterval` - Default: `null` | ||
* - `{number=}` - `recycleFreq` - Default: `1000` | ||
* - `{number=}` - `deleteOnExpire` - Default: `null` | ||
* - `{string=}` - `storageMode` - Default: `'none` | ||
* - `{object=}` - `storageImpl` - Default: `null` | ||
* - `{boolean=}` - `disabled` - Default: `false` | ||
* - `{string=}` - `storagePrefix` - Default: `"angular-cache.caches."` | ||
* | ||
* @returns {DSCache} New instance of DSCache. | ||
*/ | ||
DSCacheFactory.createCache = createCache; | ||
|
||
DSCacheFactory.version = version; | ||
|
||
/** | ||
|
@@ -2039,9 +2069,9 @@ function DSCacheFactoryProvider() { | |
|
||
module.exports = DSCacheFactoryProvider; | ||
|
||
},{"../DSCache":4,"../defaults":"XjryW+"}],"Defaults":[function(require,module,exports){ | ||
module.exports=require('XjryW+'); | ||
},{}],"XjryW+":[function(require,module,exports){ | ||
},{"../DSCache":4,"../defaults":"kH9dpy"}],"Defaults":[function(require,module,exports){ | ||
module.exports=require('kH9dpy'); | ||
},{}],"kH9dpy":[function(require,module,exports){ | ||
var defaults = { | ||
/** | ||
* @doc overview | ||
|
@@ -2335,7 +2365,7 @@ module.exports = { | |
* @id angular-cache | ||
* @name Overview | ||
* @description | ||
* __Version:__ 3.0.3 | ||
* __Version:__ 3.1.0 | ||
* | ||
* ## Install | ||
* | ||
|
@@ -2355,7 +2385,7 @@ module.exports = { | |
* also consumable by Browserify and you should be able to `require('angular-cache')`. The `main` file is `src/index.js`. | ||
* | ||
* #### Manual download | ||
* Download angular-cache.3.0.3.js from the [Releases](https://github.com/jmdobry/angular-cache/releases) | ||
* Download angular-cache.3.1.0.js from the [Releases](https://github.com/jmdobry/angular-cache/releases) | ||
* section of the angular-cache GitHub project. | ||
* | ||
* ## Load into Angular | ||
|
@@ -2418,4 +2448,4 @@ module.exports = { | |
} | ||
}; | ||
|
||
},{}]},{},[21]) | ||
},{}]},{},[21]); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters