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

Don't re-run the selector after update #1701

Merged
merged 2 commits into from Mar 25, 2021
Merged

Don't re-run the selector after update #1701

merged 2 commits into from Mar 25, 2021

Conversation

timdorr
Copy link
Member

@timdorr timdorr commented Mar 25, 2021

Fixes #1697

We can avoid running the selector twice by setting the latestStoreState at the same time as setting the latestSelectedState. If the store state hasn't changed, then the selector won't as well (since it's pure).

Fixes #1697

We can avoid running the selector twice by setting the latestStoreState at the same time as setting the latestSelectedState. If the store state hasn't changed, then the selector won't as well (since it's pure).
@github-actions
Copy link

github-actions bot commented Mar 25, 2021

Size Change: +15 B (0%)

Total Size: 26.5 kB

Filename Size Change
dist/react-redux.js 21.3 kB +12 B (0%)
dist/react-redux.min.js 5.22 kB +3 B (0%)

compressed-size-action

@netlify
Copy link

netlify bot commented Mar 25, 2021

Deploy preview for react-redux-docs ready!

Built with commit 3146b35

https://deploy-preview-1701--react-redux-docs.netlify.app

@netlify
Copy link

netlify bot commented Mar 25, 2021

Deploy preview for react-redux-docs ready!

Built with commit b92a139

https://deploy-preview-1701--react-redux-docs.netlify.app

@timdorr timdorr merged commit 07365ee into master Mar 25, 2021
@timdorr timdorr deleted the deselect branch March 25, 2021 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

selector in useSelector called one more time after forceUpdate inside hook
2 participants