Browse Source

refactor: rename param on function watch (#134)

扩散性百万甜面包 6 years ago
parent
commit
d2d32d3810
1 changed files with 4 additions and 4 deletions
  1. 4 4
      packages/runtime-core/src/apiWatch.ts

+ 4 - 4
packages/runtime-core/src/apiWatch.ts

@@ -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)
   }
 }