-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Is there a way to dynamically configure the size? #128
Comments
@mfbx9da4 can you describe the use case? |
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. |
@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 |
WeakMap is not available in react native |
What do you mean? |
Although I haven't tested myself I saw this comment "WeakRef is not supported in Hermes or JSC on Android". I believe them! |
@mfbx9da4 |
No description provided.
The text was updated successfully, but these errors were encountered: