diff --git a/src/vanilla/store.ts b/src/vanilla/store.ts index 5eb2390157..6c20762127 100644 --- a/src/vanilla/store.ts +++ b/src/vanilla/store.ts @@ -58,9 +58,9 @@ const patchPromiseForCancelability = (promise: PromiseLike) => { } const isPromiseLike = ( - x: unknown, -): x is PromiseLike & { onCancel?: (fn: CancelHandler) => void } => - typeof (x as any)?.then === 'function' + p: unknown, +): p is PromiseLike & { onCancel?: (fn: CancelHandler) => void } => + typeof (p as any)?.then === 'function' /** * State tracked for mounted atoms. An atom is considered "mounted" if it has a @@ -440,8 +440,6 @@ const buildStore = (...storeArgs: StoreArgs): Store => { returnAtomValue(readAtomState(undefined, atom)) const getMountedOrBatchDependents = ( - batch: Batch, - atom: Atom, atomState: AtomState, ): Map => { const dependents = new Map() @@ -501,7 +499,7 @@ const buildStore = (...storeArgs: StoreArgs): Store => { } visiting.add(a) // Push unvisited dependents onto the stack - for (const [d, s] of getMountedOrBatchDependents(batch, a, aState)) { + for (const [d, s] of getMountedOrBatchDependents(aState)) { if (a !== d && !visiting.has(d)) { stack.push([d, s]) }