Skip to content

Commit

Permalink
Update packages/reactivity/src/computed.ts
Browse files Browse the repository at this point in the history
Co-authored-by: edison <daiwei521@126.com>
  • Loading branch information
johnsoncodehk and edison1105 authored Sep 22, 2023
1 parent f59957d commit 196cdd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/reactivity/src/computed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export class ComputedRefImpl<T> {
if (!self._cacheable || self.effect.dirty) {
const newValue = self.effect.run()!
const changed = hasChanged(self._value, newValue)
self._value = newValue
if(changed) {
self._value = newValue
if (changed) {
triggerRefValue(self, DirtyLevels.ComputedValueDirty)
}
Expand Down

0 comments on commit 196cdd3

Please sign in to comment.