Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kashe

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kashe - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

3

package.json
{
"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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc