Comments (7)
@mfbx9da4 can you describe the use case?
from memoizee.
Suppose you have a list of items. Each item has some derived data which you would like to cache so that stays referentially identical to avoid unnecessary re-renders in React. The number of items to cache will depend on the user and will change over time. It's easy to know how big that list is at runtime and therefore trivial to know how big that cache size should be but impossible to have a good default size up front.
from memoizee.
@mfbx9da4 This looks to me as a use case that's best served by weak map based configuration.
So the cache is attached to an item, and if that item is disposed, then derived data you cached for it will also be disposed
from memoizee.
WeakMap is not available in react native
from memoizee.
WeakMap is not available in react native
What do you mean? WeakMap
is a native JavaScript interface and this is a package that requires the JavaScript runtime to be run
from memoizee.
Although I haven't tested myself I saw this comment "WeakRef is not supported in Hermes or JSC on Android". I believe them!
from memoizee.
@mfbx9da4 memoizee
under the hook doesn't use WeakRef
but WeakMap
, which as I search seems supported by all engines
from memoizee.
Related Issues (20)
- 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
- Feature Request: Wouldn't it be good if we could use a Redis backend? HOT 2
- max option does not work with promise option HOT 1
- Option to return prior cached value on update failure HOT 5
- Package is showing a vulnerability HOT 7
- [email protected] is broken due to node requirement HOT 10
- typo in engines.node HOT 20
- Found a mistake here that breaks our Pipeline HOT 2
- Codecov badge HOT 2
- Memory leak when using `maxAge` on node.js HOT 2
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.