Skip to content

Commit

Permalink
wip: remove force flag
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Oct 8, 2024
1 parent 170dc0f commit cd67e40
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/vanilla/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,9 @@ const buildStore = (getAtomState: StoreArgs[0]): Store => {
atom: Atom<Value>,
atomState: AtomState<Value>,
dirtyAtoms?: Set<AnyAtom>,
force?: boolean,
): AtomState<Value> => {
// See if we can skip recomputing this atom.
if (!force && isAtomStateInitialized(atomState)) {
if (isAtomStateInitialized(atomState)) {
// If the atom is mounted, we can use the cache.
// because it should have been updated by dependencies.
if (atomState.m && !dirtyAtoms?.has(atom)) {
Expand Down Expand Up @@ -471,7 +470,7 @@ const buildStore = (getAtomState: StoreArgs[0]): Store => {
}
}
if (hasChangedDeps) {
readAtomState(pending, a, aState, markedAtoms, true)
readAtomState(pending, a, aState, markedAtoms)
mountDependencies(pending, a, aState)
if (prevEpochNumber !== aState.n) {
addPendingAtom(pending, a, aState)
Expand Down

0 comments on commit cd67e40

Please sign in to comment.