Skip to content

Commit f59e61d

Browse files
committed
refactor(internals): pass building blocks into internal functions
Switch internal building-block function signatures and call sites from store-first to buildingBlocks-first, and update buildStore to wire store APIs from frozen building blocks while keeping weak map storage. Made-with: Cursor
1 parent 4a309e8 commit f59e61d

File tree

3 files changed

+143
-142
lines changed

3 files changed

+143
-142
lines changed

src/react/useAtomValue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const createContinuablePromise = <T>(
8585
continuablePromiseMap.set(nextValue, continuablePromise!)
8686
curr = nextValue
8787
nextValue.then(onFulfilled(nextValue), onRejected(nextValue))
88-
registerAbortHandler(store, nextValue, onAbort)
88+
registerAbortHandler(buildingBlocks, nextValue, onAbort)
8989
} else {
9090
resolve(nextValue)
9191
}
@@ -94,7 +94,7 @@ const createContinuablePromise = <T>(
9494
}
9595
}
9696
promise.then(onFulfilled(promise), onRejected(promise))
97-
registerAbortHandler(store, promise, onAbort)
97+
registerAbortHandler(buildingBlocks, promise, onAbort)
9898
})
9999
continuablePromiseMap.set(promise, continuablePromise)
100100
}

0 commit comments

Comments
 (0)