Skip to content

Commit

Permalink
Avoid variable naming conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
timdorr committed Mar 25, 2021
1 parent 3146b35 commit b92a139
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hooks/useSelector.js
Expand Up @@ -64,15 +64,15 @@ function useSelectorWithStoreAndSubscription(
useIsomorphicLayoutEffect(() => {
function checkForUpdates() {
try {
const storeState = store.getState()
const newSelectedState = latestSelector.current(storeState)
const newStoreState = store.getState()
const newSelectedState = latestSelector.current(newStoreState)

if (equalityFn(newSelectedState, latestSelectedState.current)) {
return
}

latestSelectedState.current = newSelectedState
latestStoreState.current = storeState
latestStoreState.current = newStoreState
} catch (err) {
// we ignore all errors here, since when the component
// is re-rendered, the selectors are called again, and
Expand Down

0 comments on commit b92a139

Please sign in to comment.