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

Check why we no longer bail out of subscription checks when store.getState() hasn't changed #2089

Open
markerikson opened this issue Dec 1, 2023 · 1 comment
Milestone

Comments

@markerikson
Copy link
Contributor

In v7, we definitely bailed out of useSelector if the store state hadn't changed:

const newStoreState = store.getState()
// Avoid calling selector multiple times if the store's state has not changed
if (newStoreState === latestStoreState.current) {
return
}

Per reduxjs/redux#4627 , there's questions of whether it still does that correctly in v8 with useSyncExternalStore. Should look into this.

(also, there's a question of whether we should bail out inside subscriber callbacks, or before calling them)

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

No branches or pull requests

3 participants
@markerikson @gentlee and others