Skip to content

Commit

Permalink
Merge branch 'main' into fix-derived-recompute-not-changing
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi authored Jan 7, 2025
2 parents 3b435d7 + 91af445 commit 04734ef
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 @@ -769,7 +769,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 @@ -781,7 +781,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 04734ef

Please sign in to comment.