Skip to content
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

More accurate check for cache-hit in memoize3 #1207

Merged
merged 1 commit into from
Jan 23, 2018

Conversation

mohawk2
Copy link
Contributor

@mohawk2 mohawk2 commented Jan 21, 2018

WeakMap.get returns undefined on cache miss. Checking for false instead of undefined could give a false cache-miss and recalculate when a false value is returned by the memoised function with those params.

`WeakMap.get` returns `undefined` on cache miss. Checking for false instead of `undefined` will give a false cache-miss and recalculate when a false value is returned by the memoised function.
@leebyron leebyron merged commit bc33f2e into graphql:master Jan 23, 2018
@leebyron
Copy link
Contributor

Thanks for adding this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants