Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(readonly): remove useless code #812

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/apis/computed.ts
Expand Up @@ -97,11 +97,8 @@ export function computed<T>(
}
}

return createRef<T>(
{
get: computedGetter,
set: computedSetter,
},
!setter
)
return createRef<T>({
get: computedGetter,
set: computedSetter,
})
}
2 changes: 1 addition & 1 deletion src/reactivity/ref.ts
Expand Up @@ -58,7 +58,7 @@ export class RefImpl<T> implements Ref<T> {
}
}

export function createRef<T>(options: RefOption<T>, readonly = false) {
export function createRef<T>(options: RefOption<T>) {
const r = new RefImpl<T>(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.
Expand Down