Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Oct 9, 2024
1 parent 21d45e5 commit b3a7793
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vanilla/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,9 @@ const buildStore = (getAtomState: StoreArgs[0]): Store => {
): AtomState<Value> => {
// See if we can skip recomputing this atom.
if (isAtomStateInitialized(atomState)) {
// If the atom is mounted, we can use the cache.
// If the atom is mounted, we can use cached atom state.
// because it should have been updated by dependencies.
// We can't use the cache if the atom is dirty.
if (atomState.m && !dirtyAtoms?.has(atom)) {
return atomState
}
Expand Down

0 comments on commit b3a7793

Please sign in to comment.