Skip to content

Commit d2d32d3

Browse files
himself65yyx990803
authored andcommitted
refactor: rename param on function watch (vuejs#134)
1 parent 5eacfaf commit d2d32d3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/runtime-core/src/apiWatch.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@ export function watch(
7070
| WatcherSource<unknown>
7171
| WatcherSource<unknown>[]
7272
| SimpleEffect,
73-
effectOrOptions?:
73+
cbOrOptions?:
7474
| ((value: any, oldValue: any, onCleanup: CleanupRegistrator) => any)
7575
| WatchOptions,
7676
options?: WatchOptions
7777
): StopHandle {
78-
if (isFunction(effectOrOptions)) {
78+
if (isFunction(cbOrOptions)) {
7979
// effect callback as 2nd argument - this is a source watcher
80-
return doWatch(effectOrSource, effectOrOptions, options)
80+
return doWatch(effectOrSource, cbOrOptions, options)
8181
} else {
8282
// 2nd argument is either missing or an options object
8383
// - this is a simple effect watcher
84-
return doWatch(effectOrSource, null, effectOrOptions)
84+
return doWatch(effectOrSource, null, cbOrOptions)
8585
}
8686
}
8787

0 commit comments

Comments
 (0)