- Notifications
You must be signed in to change notification settings - Fork666
cacheSize option for defaultMemoize#210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
cacheSize option for defaultMemoize#210
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codecov-io commentedJan 10, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Current coverage is 100% (diff: 100%)@@ master #210 diff @@==================================== Files 1 1 Lines 12 18 +6 Methods 0 0 Messages 0 0 Branches 0 0 ====================================+ Hits 12 18 +6 Misses 0 0 Partials 0 0
|
coveralls commentedJan 10, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
3 similar comments
coveralls commentedJan 10, 2017
coveralls commentedJan 10, 2017
coveralls commentedJan 10, 2017
ivawzh commentedApr 21, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thank@b6pzeusbc54tvhw5jgpyw8pwz2x6gs , this was an enlightenment. importmemoizerfrom'fast-memoize'import{createSelectorCreator}from'reselect'// Why not Lodash's memoize?// Because that won't work when the function takes more than one argument. And this is fast.exportconstcreateSelector=createSelectorCreator(memoizer)
|
adnelson commentedNov 6, 2019
@ivawzh that's a great solution -- it would be super helpful if this were in the |
Superseded by#513 . |
As 3rd argument, now defaultMemoize() can get the
cacheSize.There are two arrays to store previous argument arrays, previous results.
cacheSizefeature is designed as follows:In general, there is high a probability that last argument is used again.
So last arguemnts and result are added or updated to index: 0 in cacheArgsArr
andcacheResultArr`Please feel free to contact us if you have something lacking.