-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Change what defaultMemoize compares with isEqual #1175
Conversation
@brandonroberts |
I'm going to nitpick a bit and say that I find the name Let me show you want I'm trying to say:
The If this makes sense... 😅 |
I'd rather not duplicate the code with the second
|
I'm not sure if I'm following, how would this increase the size? |
So it failed a few tests that were testing memoization with custom equality |
I think adding the isResultEqual as a new third argument would be better. No breaking changes + maybe someone really wants to compare arguments and not results. |
I've extracted result checking into its own argument, so now it's 100% backwards compatible. PTAL :) |
@alex-okrushko I will take a look. I still think this would be a change in behavior. Selectors that fire a second time before would not if the results were the same, correct? Have you seen any impact on large sets of data? |
@brandonroberts I don't think there would be a change in behavior. All previously written tests are exactly the same now. If 3-rd argument I'm reruning all the tests within G again.
|
FYI, all Google tests pass with this change. |
Thanks! |
Also renamed isEqual to isResultEqual to be clear what is compared
This is the fix for #1157