Skip to content

Commit 63a06a1

Browse files
committed
chore: use hasChanged() instead of !==
1 parent 9ec8e32 commit 63a06a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/reactivity/src/computed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DebuggerOptions, ReactiveEffect } from './effect'
22
import { Ref, trackRefValue, triggerRefValue } from './ref'
3-
import { isFunction, NOOP } from '@vue/shared'
3+
import { hasChanged, isFunction, NOOP } from '@vue/shared'
44
import { ReactiveFlags, toRaw } from './reactive'
55
import { Dep } from './dep'
66

@@ -71,7 +71,7 @@ export class ComputedRefImpl<T> {
7171
trackRefValue(self)
7272
if (self._dirty || !self._cacheable) {
7373
const newValue = self.effect.run()!
74-
if (self._value !== newValue) {
74+
if (hasChanged(self._value, newValue)) {
7575
triggerRefValue(this, undefined)
7676
}
7777
self._value = newValue

0 commit comments

Comments
 (0)