-
Notifications
You must be signed in to change notification settings - Fork 27
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: memo
separate key for reading and writing cached values
#333
base: main
Are you sure you want to change the base?
Conversation
memo
cache read keys from set keysmemo
separate key for reading and writing cached values
memo
separate key for reading and writing cached values memo
separate key for reading and writing cached values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hey, thanks for the PR. 🎉 Not sure about this one. Seems very niche at first glance. Especially considering the +87% size increase, we'll need to justify the feature using real world use cases (feel free to list some). Another option would be to come up with another function built purposely for this need. |
The size increase is mostly because of the import of |
Hey @hugo082, good to hear from you! Allow me to clarify what I'm asking for. A “use case” is a practical scenario where a function solves a specific problem or fulfills a need. It emphasizes why and when the function is used, rather than delving into the technical details of how it works. For instance, the use case for a
|
Summary
You can optionally use a separate key for reading and writing cached values by providing a
setKey
function.This allows for more flexible cache management and sharing of cached values between different function calls.
For any code change,
Does this PR introduce a breaking change?
No
Bundle impact
src/curry/memo.ts
Footnotes
Function size includes the
import
dependencies of the function. ↩