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)