From 20cc2a806be462e6b7448bf6d06832f0ae1f96a6 Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Tue, 7 Jan 2025 21:50:27 +0900 Subject: [PATCH] refactor: following up #2912 (#2915) --- src/vanilla/store.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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]) }