diff --git a/src/apis/computed.ts b/src/apis/computed.ts index 2cac40a8..50f4cd8f 100644 --- a/src/apis/computed.ts +++ b/src/apis/computed.ts @@ -97,11 +97,8 @@ export function computed( } } - return createRef( - { - get: computedGetter, - set: computedSetter, - }, - !setter - ) + return createRef({ + get: computedGetter, + set: computedSetter, + }) } diff --git a/src/reactivity/ref.ts b/src/reactivity/ref.ts index b251f693..fb1b8340 100644 --- a/src/reactivity/ref.ts +++ b/src/reactivity/ref.ts @@ -58,7 +58,7 @@ export class RefImpl implements Ref { } } -export function createRef(options: RefOption, readonly = false) { +export function createRef(options: RefOption) { const r = new RefImpl(options) // seal the ref, this could prevent ref from being observed // It's safe to seal the ref, since we really shouldn't extend it.