re-reselect
Advanced tools
Comparing version 2.0.0 to 2.1.0
# Change log | ||
## 2.1.0 | ||
### New Features | ||
* Expose `cache` property | ||
## 2.0.0 | ||
@@ -4,0 +10,0 @@ |
@@ -324,2 +324,4 @@ (function (global, factory) { | ||
selector.cache = cache; | ||
return selector; | ||
@@ -326,0 +328,0 @@ }; |
@@ -320,2 +320,4 @@ import { createSelector } from 'reselect'; | ||
selector.cache = cache; | ||
return selector; | ||
@@ -322,0 +324,0 @@ }; |
@@ -324,2 +324,4 @@ 'use strict'; | ||
selector.cache = cache; | ||
return selector; | ||
@@ -326,0 +328,0 @@ }; |
{ | ||
"name": "re-reselect", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Enhance Reselect selectors with deeper memoization and cache management", | ||
@@ -48,12 +48,12 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"all-contributors-cli": "^4.3.0", | ||
"all-contributors-cli": "^4.11.1", | ||
"babel-core": "^6.23.1", | ||
"babel-jest": "^19.0.0", | ||
"babel-jest": "^22.4.3", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-preset-es2015": "^6.22.0", | ||
"babel-register": "^6.23.0", | ||
"coveralls": "^3.0.0", | ||
"coveralls": "^3.0.1", | ||
"cross-env": "^5.0.5", | ||
"husky": "^0.14.3", | ||
"jest": "^19.0.2", | ||
"jest": "^22.4.3", | ||
"lint-staged": "^4.0.3", | ||
@@ -75,5 +75,6 @@ "prettier": "^1.11.1", | ||
"__util__" | ||
] | ||
], | ||
"testEnvironment": "node" | ||
}, | ||
"sideEffects": false | ||
} |
@@ -78,2 +78,3 @@ # Re-reselect | ||
* [reReselectInstance`.resultFunc`](#rereselectinstanceresultfunc) | ||
* [reReselectInstance`.cache`](#rereselectinstancecache) | ||
@@ -395,2 +396,6 @@ ## Installation | ||
### reReselectInstance`.cache` | ||
Get cacheObject instance being used by the selector (for advanced caching operations like [this](https://github.com/toomuchdesign/re-reselect/issues/40)). | ||
## Todo's | ||
@@ -397,0 +402,0 @@ |
@@ -178,3 +178,3 @@ /* eslint comma-dangle: 0 */ | ||
describe('resultFunc', () => { | ||
describe('resultFunc property', () => { | ||
it('Should point to provided result function', () => { | ||
@@ -187,2 +187,13 @@ const cachedSelector = createCachedSelector(() => {}, resultFunc)( | ||
}); | ||
describe('cache property', () => { | ||
it('Should point to currently used cacheObject', () => { | ||
const currentCacheObject = new FlatObjectCache(); | ||
const cachedSelector = createCachedSelector(resultFunc)(arg1 => arg1, { | ||
cacheObject: currentCacheObject, | ||
}); | ||
expect(cachedSelector.cache).toBe(currentCacheObject); | ||
}); | ||
}); | ||
}); |
@@ -34,2 +34,3 @@ import {createSelector} from 'reselect'; | ||
resultFunc: C; | ||
cache: ICacheObject; | ||
}; | ||
@@ -71,2 +72,3 @@ | ||
resultFunc: C; | ||
cache: ICacheObject; | ||
}; | ||
@@ -73,0 +75,0 @@ |
@@ -58,2 +58,4 @@ import {createSelector} from 'reselect'; | ||
selector.cache = cache; | ||
return selector; | ||
@@ -60,0 +62,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
148877
2967
440
0