Skip to content

Commit

Permalink
drop store changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaskasky committed Jan 15, 2025
1 parent 555738f commit a1e1964
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/vanilla/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ type Mounted = {
readonly l: Set<() => void>
/** Set of mounted atoms that the atom depends on. */
readonly d: Set<AnyAtom>
/** Set of dependencies added asynchronously */
readonly q: Set<AnyAtom>
/** Set of mounted atoms that depends on the atom. */
readonly t: Set<AnyAtom>
/** Function to run when the atom is unmounted. */
Expand Down Expand Up @@ -305,8 +303,10 @@ const buildStore = (...storeArgs: StoreArgs): Store => {
for (const a of atomState.d.keys()) {
addPendingPromiseToDependency(atom, valueOrPromise, ensureAtomState(a))
}
atomState.v = valueOrPromise
} else {
atomState.v = valueOrPromise
}
atomState.v = valueOrPromise
delete atomState.e
if (!hasPrevValue || !Object.is(prevValue, atomState.v)) {
++atomState.n
Expand Down Expand Up @@ -404,11 +404,6 @@ const buildStore = (...storeArgs: StoreArgs): Store => {
const valueOrPromise = atomRead(atom, getter, options as never)
setAtomStateValueOrPromise(atom, atomState, valueOrPromise)
if (isPromiseLike(valueOrPromise)) {
if (batch) {
addBatchFunc(batch, 0, () => atomState.m?.q.clear())
} else {
atomState.m?.q.clear()
}
valueOrPromise.onCancel?.(() => controller?.abort())
valueOrPromise.then(mountDependenciesIfAsync, mountDependenciesIfAsync)
}
Expand Down Expand Up @@ -604,7 +599,6 @@ const buildStore = (...storeArgs: StoreArgs): Store => {
atomState.m = {
l: new Set(),
d: new Set(atomState.d.keys()),
q: new Set(),
t: new Set(),
}
atomState.h?.()
Expand Down

0 comments on commit a1e1964

Please sign in to comment.