Skip to content

Commit

Permalink
refactor: rename param on function watch (vuejs#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 authored and yyx990803 committed Oct 6, 2019
1 parent 5eacfaf commit d2d32d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/runtime-core/src/apiWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit d2d32d3

Please sign in to comment.