Comments (3)
Let me take a look
from memoize-one.
The doc looks correct. The simpleIsEqual
function checks if the arguments' length has changed. If the length has changed, simpleIsEqual
returns false
right away.
newArgs.length === lastArgs.length &&
newArgs.every(
(newArg: mixed, index: number): boolean =>
shallowEqual(newArg, lastArgs[index]),
);
from memoize-one.
'Check anything' was a little ambiguous for me. I thought it doesn't check argument length. 🤦♂️
After reading next sentence:
You are welcome to decide if you want to return false if the length of the arguments is not equal.
I thought you didn't do that now and the following snippet is a way to override the current behavior.
Sorry for my mistake.
from memoize-one.
Related Issues (20)
- Memoize not working properly with `NaN` HOT 4
- Memoize not working properly with arrays HOT 2
- Memoize not working properly with objects and custom comparator HOT 1
- React useMemo style API HOT 2
- Doc: please update the performance numbers + the benchmark HOT 3
- Cannot find v5.2.0 via NPM HOT 1
- `5.2.0` introduces a breaking change HOT 28
- MD5 checksum for object parameters HOT 2
- PSA: Intention to remove ie11 support
- Don't allow `resultFn` to resolve to implicit any params HOT 4
- "This expression is not callable" type error when trying to use this package from ESM module HOT 2
- Analysis: 64% of dependency updates in this repository can be merged. HOT 1
- TypeScript errors with modules HOT 3
- Memoizing TypeScript functions with generics
- Does memoize-one support Promises? HOT 3
- TypeError: memoizeOne is not a function HOT 4
- Same parameters, different locations will also rerun HOT 2
- Simple code in TS not working HOT 3
- Memoize one is failing within a test environment. Value is not changed yet memoized function is called. HOT 2
- Misleading documentation HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memoize-one.