From e43f5935b5eb282376357b33fd4561df863eb67c Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 27 Jan 2020 13:13:38 -0500 Subject: [PATCH] refactor: better variable naming --- packages/reactivity/src/ref.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index fccff406..6b316588 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -28,19 +28,19 @@ export function isRef(r: any): r is Ref { return r ? r._isRef === true : false } -export function ref(raw: T): T -export function ref(raw: T): Ref +export function ref(value: T): T +export function ref(value: T): Ref export function ref(): Ref -export function ref(raw?: unknown) { - if (isRef(raw)) { - return raw +export function ref(value?: unknown) { + if (isRef(value)) { + return value } - raw = convert(raw) + value = convert(value) if (__SSR__) { return { _isRef: true, - value: raw + value } } @@ -48,10 +48,10 @@ export function ref(raw?: unknown) { _isRef: true, get value() { track(r, TrackOpTypes.GET, 'value') - return raw + return value }, set value(newVal) { - raw = convert(newVal) + value = convert(newVal) trigger( r, TriggerOpTypes.SET,