Comments (1)
@jackgeek Technically there's no bug, thing is that values are memoized after async function resolves, and it's at resolution point where max
option is evaluated.
See
memoizedAsync(1); // cache size still 0
memoizedAsync(2); // cache size still 0
memoizedAsync(3); // cache size still 0
memoizedAsync(4); // cache size still 0
vs
await memoizedAsync(1); // cache size 1
await memoizedAsync(2); // cache size 2
await memoizedAsync(3); // cache size 3
await memoizedAsync(4); // cache size 4
Still, I agree that desired would be to handle the cache limit at the invocation moment and not at the function resolution moment. I've updated the v1.0 draft proposal to take that into account
from memoizee.
Related Issues (20)
- Cannot find module 'event-emitter' HOT 3
- Dependency on "D" renders this useless HOT 4
- Doesn't work with snowpack. HOT 3
- Is not caching non-promise returning calls the intended behavior? HOT 1
- Promise rejections not cleared immediately from cache HOT 2
- Callback for cache access HOT 5
- setter method HOT 1
- How to deal with functions taking dict args? HOT 6
- Rollup fails to bundle memoizee correctly HOT 6
- feat: let default nomalizer be more general HOT 1
- replace `es5-ext` with `core-js@^3` HOT 2
- Cannot import memoizee HOT 3
- Memoizing a function without arguments HOT 1
- Allow `maxAgeSinceAccess` in addition to `maxAge` HOT 11
- Why is the memoizee so slow? HOT 2
- Is there a way to dynamically configure the size? HOT 7
- Feature Request: Wouldn't it be good if we could use a Redis backend? HOT 2
- Option to return prior cached value on update failure HOT 5
- Package is showing a vulnerability HOT 7
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 memoizee.