From d2d32d381047ff8b4d351ee49f46a52d67c517df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=A9=E6=95=A3=E6=80=A7=E7=99=BE=E4=B8=87=E7=94=9C?= =?UTF-8?q?=E9=9D=A2=E5=8C=85?= Date: Sun, 6 Oct 2019 23:27:09 +0800 Subject: [PATCH] refactor: rename param on function watch (#134) --- packages/runtime-core/src/apiWatch.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index 139767c6560..b7139d62ea6 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -70,18 +70,18 @@ export function watch( | WatcherSource | WatcherSource[] | SimpleEffect, - effectOrOptions?: + cbOrOptions?: | ((value: any, oldValue: any, onCleanup: CleanupRegistrator) => any) | WatchOptions, options?: WatchOptions ): StopHandle { - if (isFunction(effectOrOptions)) { + if (isFunction(cbOrOptions)) { // effect callback as 2nd argument - this is a source watcher - return doWatch(effectOrSource, effectOrOptions, options) + return doWatch(effectOrSource, cbOrOptions, options) } else { // 2nd argument is either missing or an options object // - this is a simple effect watcher - return doWatch(effectOrSource, null, effectOrOptions) + return doWatch(effectOrSource, null, cbOrOptions) } }