]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: rename param on function watch (#134)
author扩散性百万甜面包 <himself65@outlook.com>
Sun, 6 Oct 2019 15:27:09 +0000 (23:27 +0800)
committerEvan You <yyx990803@gmail.com>
Sun, 6 Oct 2019 15:27:09 +0000 (11:27 -0400)
packages/runtime-core/src/apiWatch.ts

index 139767c65607c43af5c4375f22fd9afbcb90cad7..b7139d62ea67eb72eeb6df21d600b8aec734d057 100644 (file)
@@ -70,18 +70,18 @@ export function watch(
     | WatcherSource<unknown>
     | WatcherSource<unknown>[]
     | 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)
   }
 }