Skip to content

Commit

Permalink
Merge branch 'main' into batch-simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi authored Jan 7, 2025
2 parents adf2153 + 91af445 commit fe7c699
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vanilla/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ const deriveDevStoreRev4 = (store: Store): Store & DevStoreRev4 => {
const derivedStore = store.unstable_derive((...storeArgs: [...StoreArgs]) => {
const [getAtomState, setAtomState, , atomWrite] = storeArgs
savedGetAtomState = getAtomState
storeArgs[1] = (atom, atomState) => {
storeArgs[1] = function devSetAtomState(atom, atomState) {
setAtomState(atom, atomState)
const originalMounted = atomState.h
atomState.h = (batch) => {
Expand All @@ -741,7 +741,7 @@ const deriveDevStoreRev4 = (store: Store): Store & DevStoreRev4 => {
}
}
}
storeArgs[3] = (atom, getter, setter, ...args) => {
storeArgs[3] = function devAtomWrite(atom, getter, setter, ...args) {
if (inRestoreAtom) {
return setter(atom, ...args)
}
Expand Down

0 comments on commit fe7c699

Please sign in to comment.