Skip to content

Commit

Permalink
fix to pass the test
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Oct 22, 2023
1 parent 11d8e18 commit a868c65
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vanilla/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,11 @@ export const createStore = () => {
return true
}
const aState = readAtomState(a)
return aState === s || (aState && !hasPromiseAtomValue(aState))
return (
aState === s ||
// We need to check values in case only dependencies are changed
(aState && isEqualAtomValue(aState, s))
)
})
) {
return atomState
Expand Down

0 comments on commit a868c65

Please sign in to comment.