immutable-cache
Advanced tools
+1
-1
| { | ||
| "name": "immutable-cache", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "Immutable.js enabled caching", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+2
-2
@@ -15,3 +15,3 @@ import Immutable from 'immutable'; | ||
| const SHRINK_RATIO = 0.25; | ||
| const SHRINK_THRESCHOLD = 1; | ||
| const SHRINK_THRESHOLD = 1; | ||
@@ -82,3 +82,3 @@ | ||
| if (state.size >= this._props.maxSize * SHRINK_THRESCHOLD) { | ||
| if (state.get('map').size >= this._props.maxSize * SHRINK_THRESHOLD) { | ||
| newState = removeOldKeys(state); | ||
@@ -85,0 +85,0 @@ } |
+3
-1
@@ -67,3 +67,3 @@ import {expect} from 'chai'; | ||
| let cache = new Cache({ | ||
| maxSize: 1 | ||
| maxSize: 2 | ||
| }); | ||
@@ -73,7 +73,9 @@ | ||
| cache = cache.set('keep', 'value 2'); | ||
| cache = cache.set('also', 'value 3'); | ||
| expect(cache.has('discard')).to.equal(false); | ||
| expect(cache.has('keep')).to.equal(true); | ||
| expect(cache.has('also')).to.equal(true); | ||
| }); | ||
| }); |
Sorry, the diff of this file is not supported yet
13858
0.6%275
0.73%14
-6.67%