nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / angular-cache / TRANSITION.md
1 ### 2.x.x. ---> 3.x.x - xx April 2013
2 TODO
3
4 ### 1.x.x. ---> 2.0.0 - 30 October 2013
5
6 #### Breaking API changes
7 ##### Swapped `aggressiveDelete` option for `deleteOnExpire` option.
8
9 ###### 1.x.x
10 Aggressively delete expiring items.
11 ```javascript
12 $angularCacheFactory('myNewCache', {
13     maxAge: 90000, // Items added to this cache expire after 15 minutes
14     aggressiveDelete: true // Items will be actively deleted when they expire
15 });
16 ```
17
18 Passively delete items when they are requested after they have expired.
19 ```javascript
20 $angularCacheFactory('myNewCache', {
21     maxAge: 90000, // Items added to this cache expire after 15 minutes
22     aggressiveDelete: false // Items will be actively deleted when they expire
23 });
24 ```
25
26 ###### 2.0.0
27 Aggressively delete expiring items.
28 ```javascript
29 $angularCacheFactory('myNewCache', {
30     maxAge: 90000, // Items added to this cache expire after 15 minutes
31     deleteOnExpire: 'aggressive' // Items will be actively deleted when they expire
32 });
33 ```
34
35 Passively delete items when they are requested after they have expired.
36 ```javascript
37 $angularCacheFactory('myNewCache', {
38     maxAge: 90000, // Items added to this cache expire after 15 minutes
39     deleteOnExpire: 'passive' // Items will be passively deleted when requested after expiration
40 });
41 ```
42
43 Do nothing with expired items (not in 1.x.x).
44 ```javascript
45 $angularCacheFactory('myNewCache', {
46     maxAge: 90000, // Items added to this cache expire after 15 minutes
47     deleteOnExpire: 'none' // Items will expire but not be removed
48 });
49 ```
50
51 ##### Substituted `localStorageImpl` and `sessionStorageImpl` options for just `storageImpl` option.
52
53 ###### 1.x.x
54 ```javascript
55 $angularCacheFactory('myNewCache', {
56     storageMode: 'localStorage',
57     localStorageImpl: myLocalStoragePolyfill // Use custom localStorage implementation
58 });
59
60 $angularCacheFactory('myNewCache2', {
61     storageMode: 'sessionStorage',
62     sessionStorageImpl: mySessionStoragePolyfill // Use custom sessionStorage implementation
63 });
64 ```
65
66 ###### 2.0.0
67 ```javascript
68 $angularCacheFactory('myNewCache', {
69     storageMode: 'localStorage',
70     storageImpl: myLocalStoragePolyfill // Use custom localStorage implementation
71 });
72
73 $angularCacheFactory('myNewCache2', {
74     storageMode: 'sessionStorage',
75     storageImpl: mySessionStoragePolyfill // Use custom sessionStorage implementation
76 });
77 ```
78
79 ##### Installation
80 The Bower package now contains only `dist/angular-cache.js` and `dist/angular-cache.min.js`.
81
82 ##### onExpire
83
84 ###### 1.x.x
85 ```javascript
86 cache.get('someKey', function (key, value) {
87     // do something with expired item
88 });
89 ```
90
91 ###### 2.0.0
92 ```javascript
93 cache.get('someKey', {
94     onExpire: function (key, value) {
95         // do something with expired item
96     }
97 });
98 ```