Skip to content

Commit

Permalink
chore(reactivity): avoid duplicate check
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 committed Mar 5, 2021
1 parent fbf2d68 commit 4666426
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/reactivity/src/computed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export function computed<T>(
let getter: ComputedGetter<T>
let setter: ComputedSetter<T>

if (isFunction(getterOrOptions)) {
const isFn = isFunction(getterOrOptions)
if (isFn) {
getter = getterOrOptions
setter = __DEV__
? () => {
Expand All @@ -86,6 +87,6 @@ export function computed<T>(
return new ComputedRefImpl(
getter,
setter,
isFunction(getterOrOptions) || !getterOrOptions.set
isFn || !getterOrOptions.set
) as any
}

0 comments on commit 4666426

Please sign in to comment.