Skip to content

Commit 3ffc40f

Browse files
committed
fixed #3
1 parent f581b76 commit 3ffc40f

2 files changed

+2
-0
lines changed

《响应式系统的依赖收集追踪原理》.js

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ function defineReactive (obj, key, val) {
4646
},
4747
set: function reactiveSetter (newVal) {
4848
if (newVal === val) return;
49+
val = newVal;
4950
dep.notify();
5051
}
5152
});

《响应式系统的基本原理》.js

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function defineReactive (obj, key, val) {
2121
},
2222
set: function reactiveSetter (newVal) {
2323
if (newVal === val) return;
24+
val = newVal;
2425
cb(newVal);
2526
}
2627
});

0 commit comments

Comments
 (0)