diff --git a/README.md b/README.md index 469f9e7..34eee96 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -### angular-cache (1.2.0-SNAPSHOT) is a very useful replacement for Angular's $cacheFactory. +### angular-cache (1.2.0) is a very useful replacement for Angular's $cacheFactory. Check out the [demo](http://jmdobry.github.io/angular-cache/demo/) for a quick introduction, or continue on down for more detailed information. @@ -235,9 +235,9 @@ $angularCacheFactory.get('someCache').setOptions({ capacity: 4500 }); ## Status | Version | Branch | Build status | Test Coverage | | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -| 1.2.0-SNAPSHOT | [master](https://github.com/jmdobry/angular-cache) | [![Build Status](https://travis-ci.org/jmdobry/angular-cache.png?branch=master)](https://travis-ci.org/jmdobry/angular-cache) | [Test Coverage](http://jmdobry.github.io/angular-cache/coverage/) | -| 1.2.0-SNAPSHOT | [develop](https://github.com/jmdobry/angular-cache/tree/develop) | [![Build Status](https://travis-ci.org/jmdobry/angular-cache.png?branch=develop)](https://travis-ci.org/jmdobry/angular-cache) | | -| 1.2.0-SNAPSHOT | [all](https://drone.io/github.com/jmdobry/angular-cache) | [![Build Status](https://drone.io/github.com/jmdobry/angular-cache/status.png)](https://drone.io/github.com/jmdobry/angular-cache/latest) +| 1.2.0 | [master](https://github.com/jmdobry/angular-cache) | [![Build Status](https://travis-ci.org/jmdobry/angular-cache.png?branch=master)](https://travis-ci.org/jmdobry/angular-cache) | [Test Coverage](http://jmdobry.github.io/angular-cache/coverage/) | +| 1.2.0 | [develop](https://github.com/jmdobry/angular-cache/tree/develop) | [![Build Status](https://travis-ci.org/jmdobry/angular-cache.png?branch=develop)](https://travis-ci.org/jmdobry/angular-cache) | | +| 1.2.0 | [all](https://drone.io/github.com/jmdobry/angular-cache) | [![Build Status](https://drone.io/github.com/jmdobry/angular-cache/status.png)](https://drone.io/github.com/jmdobry/angular-cache/latest) ## Download @@ -245,8 +245,8 @@ $angularCacheFactory.get('someCache').setOptions({ capacity: 4500 }); #### Latest Stable Version | Type | File | Size | | ------------- | ----------------- | ------------------- | ---- | -| Production | [angular-cache-1.2.0-SNAPSHOT.min.js](https://raw.github.com/jmdobry/angular-cache/master/dist/angular-cache-1.2.0-SNAPSHOT.min.js) | 6 KB | -| Development | [angular-cache-1.2.0-SNAPSHOT.js](https://raw.github.com/jmdobry/angular-cache/master/dist/angular-cache-1.2.0-SNAPSHOT.js) | 34 KB | +| Production | [angular-cache-1.2.0.min.js](https://raw.github.com/jmdobry/angular-cache/master/dist/angular-cache-1.2.0.min.js) | 6 KB | +| Development | [angular-cache-1.2.0.js](https://raw.github.com/jmdobry/angular-cache/master/dist/angular-cache-1.2.0.js) | 34 KB | ## Installation @@ -597,6 +597,9 @@ app.service('myService', function ($angularCacheFactory) { cache.info(); // { ..., size: 30, cacheFlushInterval: 5500, // capacity: 1.7976931348623157e+308, maxAge: null, ... } + + cache.put('someItem', 'someValue', { maxAge: 12000, aggressiveDelete: true }); + cache.info('someItem'); // { timestamp: 12345678978, maxAge: 12000, aggressiveDelete: true, isExpired: false } }); ``` See [AngularCache#setOptions](http://jmdobry.github.io/angular-cache/docs/Cache.html#setOptions) diff --git a/bower.json b/bower.json index ebbc2d1..f52f3b6 100644 --- a/bower.json +++ b/bower.json @@ -2,7 +2,7 @@ "author": "Jason Dobry", "name": "angular-cache", "description": "angular-cache is a very useful replacement for Angular's $cacheFactory.", - "version": "1.2.0-SNAPSHOT", + "version": "1.2.0", "homepage": "http://jmdobry.github.io/angular-cache/", "repository": { "type": "git", diff --git a/coverage/index.html b/coverage/index.html index d3c60b6..540f294 100644 --- a/coverage/index.html +++ b/coverage/index.html @@ -215,7 +215,7 @@

- src/ + ./src\ 96.44% (325 / 337) @@ -232,7 +232,7 @@

diff --git a/coverage/src/angular-cache.js.html b/coverage/src/angular-cache.js.html index cdb681e..346baa6 100644 --- a/coverage/src/angular-cache.js.html +++ b/coverage/src/angular-cache.js.html @@ -1,7 +1,7 @@ - Code coverage report for src/angular-cache.js + Code coverage report for ./src/angular-cache.js @@ -180,7 +180,7 @@
-

Code coverage report for src/angular-cache.js

+

Code coverage report for ./src/angular-cache.js

Statements: 96.44% (325 / 337)      @@ -195,7 +195,7 @@

Lines: 96.44% (325 / 337)     

-
All files » src/ » angular-cache.js
+
All files » ./src\ » angular-cache.js

@@ -2757,7 +2757,7 @@ 

diff --git a/coverage/src/index.html b/coverage/src/index.html index abb9db6..b7cedd9 100644 --- a/coverage/src/index.html +++ b/coverage/src/index.html @@ -1,7 +1,7 @@ - Code coverage report for src/ + Code coverage report for ./src\ @@ -180,7 +180,7 @@
-

Code coverage report for src/

+

Code coverage report for ./src\

Statements: 96.44% (325 / 337)      @@ -195,7 +195,7 @@

Lines: 96.44% (325 / 337)     

-
All files » src/
+
All files » ./src\
@@ -232,7 +232,7 @@

diff --git a/dist/angular-cache-1.2.0-SNAPSHOT.js b/dist/angular-cache-1.2.0.js similarity index 99% rename from dist/angular-cache-1.2.0-SNAPSHOT.js rename to dist/angular-cache-1.2.0.js index 7cf1867..52465f2 100644 --- a/dist/angular-cache-1.2.0-SNAPSHOT.js +++ b/dist/angular-cache-1.2.0.js @@ -1,7 +1,7 @@ /** * @author Jason Dobry - * @file angular-cache-1.2.0-SNAPSHOT.js - * @version 1.2.0-SNAPSHOT - [Homepage]{@link http://jmdobry.github.io/angular-cache/} + * @file angular-cache-1.2.0.js + * @version 1.2.0 - [Homepage]{@link http://jmdobry.github.io/angular-cache/} * @copyright (c) 2013 Jason Dobry * @license MIT * diff --git a/dist/angular-cache-1.2.0-SNAPSHOT.min.js b/dist/angular-cache-1.2.0.min.js similarity index 100% rename from dist/angular-cache-1.2.0-SNAPSHOT.min.js rename to dist/angular-cache-1.2.0.min.js diff --git a/docs/$AngularCacheFactoryProvider.html b/docs/$AngularCacheFactoryProvider.html index 7121a97..d0c1dec 100644 --- a/docs/$AngularCacheFactoryProvider.html +++ b/docs/$AngularCacheFactoryProvider.html @@ -80,7 +80,7 @@

Source:
@@ -144,7 +144,7 @@

Index

Modules

  • diff --git a/docs/AngularCache.html b/docs/AngularCache.html index 1abdee7..029a7b0 100644 --- a/docs/AngularCache.html +++ b/docs/AngularCache.html @@ -1,1269 +1,1267 @@ - - - - - JSDoc: Class: AngularCache - - - - - - - - - - -
    - -

    Class: AngularCache

    - - - - - -
    - -
    -

    - AngularCache -

    - -
    - -
    -
    - - - - -
    -

    new AngularCache(cacheId, options)

    - - -
    -
    - - -
    - Instantiated via $angularCacheFactory(cacheId[, options]) -
    - - - - - - - -
    Parameters:
    - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
cacheId - - -String - - - - - - - - - - The id of the new cache.
options - - -Object - - - - - - <optional>
- - - - - -
{{[capacity]: Number, [maxAge]: Number, [cacheFlushInterval]: Number, [aggressiveDelete]: Boolean, [onExpire]: Function, [storageMode]: String, [localStorageImpl]: Object}}
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-

<static> destroy()

- - -
-
- - -
- Completely destroy this cache. -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - -
- - - -
-

<static> get(key, onExpire) → {*}

- - -
-
- - -
- Retrieve the item from the cache with the specified key. -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
key - - -String - - - - - - - - - - The key of the item to retrieve.
onExpire - - -Function - - - - - - <optional>
- - - - - -
Callback to be executed if it is discovered the -requested item has expired.
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - -
Returns:
- - -
- The value of the item in the cache with the specified key. -
- - - -
-
- Type -
-
- -* - - -
-
- - - - -
- - - -
-

<static> info() → {Object}

- - -
-
- - -
- Return an object containing information about this cache. -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - -
Returns:
- - -
- stats Object containing information about this cache. -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - -
- - - -
-

<static> keys() → {Array}

- - -
-
- - -
- Return an array of the keys of all items currently in this cache.. -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - -
Returns:
- - -
- An array of the keys of all items currently in this cache.. -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - -
- - - -
-

<static> keySet() → {Object}

- - -
-
- - -
- Return the set of the keys of all items currently in this cache. -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - -
Returns:
- - -
- The set of the keys of all items currently in this cache. -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - -
- - - -
-

<static> put(key, value, options) → {*}

- - -
-
- - -
- Add a key-value pair with timestamp to the cache. -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
key - - -String - - - - - - - - - - The identifier for the item to add to the cache.
value - - -* - - - - - - - - - - The value of the item to add to the cache.
options - - -Object - - - - - - <optional>
- - - - - -
{{ maxAge: {Number}, aggressiveDelete: {Boolean}, timestamp: {Number} }}
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - -
Returns:
- - -
- value The value of the item added to the cache. -
- - - -
-
- Type -
-
- -* - - -
-
- - - - -
- - - -
-

<static> remove(key)

- - -
-
- - -
- Remove the specified key-value pair from this cache. -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - -String - - - - The key of the key-value pair to remove.
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - -
- - - -
-

<static> removeAll()

- - -
-
- - -
- Clear this cache. -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - -
- - - -
-

<static> setOptions(options, strict)

- - -
-
- - -
- Configure this cache with the given options. -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
options - - -Object - - - -
strict - - -Boolean - - - - If true then any existing configuration will be reset to defaults before -applying the new options, otherwise only the options specified in the hash will be altered.
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - -
- -
- - - - - - - - - - - - - - - - -
- - - - - - + + + + + JSDoc: Class: AngularCache + + + + + + + + + + +
+ +

Class: AngularCache

+ + + + + +
+ +
+

+ AngularCache +

+ +
+ +
+
+ + + + +
+

new AngularCache(cacheId, options)

+ + +
+
+ + +
+ Instantiated via $angularCacheFactory(cacheId[, options]) +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
cacheId + + +String + + + + + + + + + + The id of the new cache.
options + + +Object + + + + + + <optional>
+ + + + + +
{{[capacity]: Number, [maxAge]: Number, [cacheFlushInterval]: Number, [aggressiveDelete]: Boolean, [onExpire]: Function, [storageMode]: String, [localStorageImpl]: Object}}
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

<static> destroy()

+ + +
+
+ + +
+ Completely destroy this cache. +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

<static> get(key, onExpire) → {*}

+ + +
+
+ + +
+ Retrieve the item from the cache with the specified key. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
key + + +String + + + + + + + + + + The key of the item to retrieve.
onExpire + + +Function + + + + + + <optional>
+ + + + + +
Callback to be executed if it is discovered the requested item has expired.
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
Returns:
+ + +
+ The value of the item in the cache with the specified key. +
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + +
+ + + +
+

<static> info() → {Object}

+ + +
+
+ + +
+ Return an object containing information about this cache. +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
Returns:
+ + +
+ stats Object containing information about this cache. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + +
+ + + +
+

<static> keys() → {Array}

+ + +
+
+ + +
+ Return an array of the keys of all items currently in this cache.. +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
Returns:
+ + +
+ An array of the keys of all items currently in this cache.. +
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + +
+ + + +
+

<static> keySet() → {Object}

+ + +
+
+ + +
+ Return the set of the keys of all items currently in this cache. +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
Returns:
+ + +
+ The set of the keys of all items currently in this cache. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + +
+ + + +
+

<static> put(key, value, options) → {*}

+ + +
+
+ + +
+ Add a key-value pair with timestamp to the cache. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
key + + +String + + + + + + + + + + The identifier for the item to add to the cache.
value + + +* + + + + + + + + + + The value of the item to add to the cache.
options + + +Object + + + + + + <optional>
+ + + + + +
{{ maxAge: {Number}, aggressiveDelete: {Boolean}, timestamp: {Number} }}
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
Returns:
+ + +
+ value The value of the item added to the cache. +
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + +
+ + + +
+

<static> remove(key)

+ + +
+
+ + +
+ Remove the specified key-value pair from this cache. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +String + + + + The key of the key-value pair to remove.
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

<static> removeAll()

+ + +
+
+ + +
+ Clear this cache. +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

<static> setOptions(options, strict)

+ + +
+
+ + +
+ Configure this cache with the given options. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + +
strict + + +Boolean + + + + If true then any existing configuration will be reset to defaults before applying the new options, otherwise only the options specified in the hash will be altered.
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + diff --git a/docs/AngularCacheFactory.html b/docs/AngularCacheFactory.html index 218f32e..875f931 100644 --- a/docs/AngularCacheFactory.html +++ b/docs/AngularCacheFactory.html @@ -167,7 +167,7 @@
Parameters:
Source:
@@ -242,7 +242,7 @@

Index

Modules