Skip to content

Commit 4666426

Browse files
committed
chore(reactivity): avoid duplicate check
1 parent fbf2d68 commit 4666426

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/reactivity/src/computed.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ export function computed<T>(
7171
let getter: ComputedGetter<T>
7272
let setter: ComputedSetter<T>
7373

74-
if (isFunction(getterOrOptions)) {
74+
const isFn = isFunction(getterOrOptions)
75+
if (isFn) {
7576
getter = getterOrOptions
7677
setter = __DEV__
7778
? () => {
@@ -86,6 +87,6 @@ export function computed<T>(
8687
return new ComputedRefImpl(
8788
getter,
8889
setter,
89-
isFunction(getterOrOptions) || !getterOrOptions.set
90+
isFn || !getterOrOptions.set
9091
) as any
9192
}

0 commit comments

Comments
 (0)