-
Notifications
You must be signed in to change notification settings - Fork 86
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
Doesn't memoize the result for keys returning undefined
#66
Comments
I see how this could be the expected behaviour though, i.e. if the function returns |
@hargasinski have you benchmarked using a |
Hmmm, in my opinion this is an unexpected behaviour if not explicitly stated otherwise. |
I agree that it should be documented somewhere. I checked the source code (line 36) and looks like it calls the original function whenever the cached result is (Usually, https://github.com/caiogondim/fast-memoize.js/blob/master/src/index.js#L36 |
When the memoized function returns
undefined
for a specific parameter, another call to the memoized function runs the original function again as opposed to fetching the result from the cache.Reproducible Example:
It seems like this changed from
v2.2.8
tov2.3.0
. Is this the intended behaviour?The text was updated successfully, but these errors were encountered: