Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "kashe", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Stateless memoization replacement for reselect and memoize-one", | ||
@@ -22,2 +22,3 @@ "main": "dist/es5/index.js", | ||
"devDependencies": { | ||
"size-limit": "^0.21.1", | ||
"ts-jest": "^24.0.0", | ||
@@ -24,0 +25,0 @@ "ts-react-toolbox": "^0.2.2", |
@@ -9,2 +9,5 @@ <div align="center"> | ||
</a> | ||
<a href="https://travis-ci.org/theKashey/kashe"> | ||
<img alt="Travis" src="https://img.shields.io/travis/theKashey/kashe/master.svg?style=flat-square"> | ||
</a> | ||
</div> | ||
@@ -15,5 +18,5 @@ | ||
## Memoization | ||
Memoization is look technique. But is it reliable and _safe_? | ||
Memoization is cool technique. But is it reliable and _safe_? | ||
What is the difference between lodash.memoize, memoize-one, and React.useMemo? | ||
What is the difference between `lodash.memoize`, `memoize-one`, and `React.useMemo`? | ||
@@ -27,6 +30,8 @@ - [lodash.memoize](https://lodash.com/docs/4.17.11#memoize) is a cool thing. But but default it has endless cache size. | ||
- Is it server-side friendly? Nope, server handles many requests from many clients, and memoized value is constantly got wiped. | ||
- Is it saver-side _safe_? Oh no! Cross request memoization could be a killer! What if memoized value not got rejected?? | ||
- Is it test friendly? Nope, tests should always work the same, while memoization will make it... less predictable. | ||
- __Is it server-side friendly?__ Nope, server handles many requests from many clients, and memoized value is constantly got wiped. | ||
- __Is it saver-side _safe_?__ Oh no! Cross request memoization could be a killer! What if memoized value not got rejected?? | ||
- __Is it test friendly?__ Nope, tests should always work the same, while memoization will make it... less predictable. | ||
So - it's time to fix all the problems above. | ||
# API | ||
@@ -102,3 +107,3 @@ - kashe - memoization | ||
- `fork(function: T):T` - create a copy of a selector, with overiden internal cache. | ||
`fork` has the same effect `inbox` has, but not adding a leading argument. First argument still expected to be an object, array of a function. | ||
`fork` has the same effect `inbox` has, but not adding a leading argument. First argument still expected to be an object, array, or a function. | ||
```js | ||
@@ -114,2 +119,7 @@ const selector = (state) => ({state}); | ||
#### Size | ||
1.14 kb | ||
# Cook-book | ||
## Per-instance one argument memoization | ||
@@ -160,2 +170,4 @@ Let's imagine a simple HOC | ||
A `Reselect`-compatible API | ||
> TLDR: it just replaces default memoization for reselect - `createSelectorCreator(strongMemoize);`. `strongMemoize` - | ||
is not public API yet. | ||
@@ -252,3 +264,3 @@ Reselect is a great library, but it has one limitation - stores only one result. There are a few attempts | ||
# PS | ||
# Kashe-y? | ||
When I first time I heard my nickname - `kashey` pronounces as `cache` - I decides to create a caching library one day. Here we go. | ||
@@ -255,0 +267,0 @@ |
{ | ||
"private": true, | ||
"main": "../dist/es5/.js", | ||
"main": "../dist/es5/reselect.js", | ||
"jsnext:main": "../dist/es2015/reselect.js", | ||
@@ -5,0 +5,0 @@ "module": "../dist/es2015/reselect.js", |
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
31917
264
0
4