Skip to content

Commit 9043d0d

Browse files
authored
refactor(reactivity): use explicit assignments. (#4401)
1 parent ebd0bac commit 9043d0d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/reactivity/src/ref.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function ref<T extends object>(value: T): ToRef<T>
7979
export function ref<T>(value: T): Ref<UnwrapRef<T>>
8080
export function ref<T = any>(): Ref<T | undefined>
8181
export function ref(value?: unknown) {
82-
return createRef(value)
82+
return createRef(value, false)
8383
}
8484

8585
export function shallowRef<T extends object>(
@@ -98,7 +98,7 @@ class RefImpl<T> {
9898
public dep?: Dep = undefined
9999
public readonly __v_isRef = true
100100

101-
constructor(value: T, public readonly _shallow = false) {
101+
constructor(value: T, public readonly _shallow: boolean) {
102102
this._rawValue = _shallow ? value : toRaw(value)
103103
this._value = _shallow ? value : convert(value)
104104
}
@@ -118,7 +118,7 @@ class RefImpl<T> {
118118
}
119119
}
120120

121-
function createRef(rawValue: unknown, shallow = false) {
121+
function createRef(rawValue: unknown, shallow: boolean) {
122122
if (isRef(rawValue)) {
123123
return rawValue
124124
}

0 commit comments

Comments
 (0)