refactor: rename param on function watch (#134)
This commit is contained in:
parent
5eacfaf210
commit
d2d32d3810
@ -70,18 +70,18 @@ export function watch(
|
|||||||
| WatcherSource<unknown>
|
| WatcherSource<unknown>
|
||||||
| WatcherSource<unknown>[]
|
| WatcherSource<unknown>[]
|
||||||
| SimpleEffect,
|
| SimpleEffect,
|
||||||
effectOrOptions?:
|
cbOrOptions?:
|
||||||
| ((value: any, oldValue: any, onCleanup: CleanupRegistrator) => any)
|
| ((value: any, oldValue: any, onCleanup: CleanupRegistrator) => any)
|
||||||
| WatchOptions,
|
| WatchOptions,
|
||||||
options?: WatchOptions
|
options?: WatchOptions
|
||||||
): StopHandle {
|
): StopHandle {
|
||||||
if (isFunction(effectOrOptions)) {
|
if (isFunction(cbOrOptions)) {
|
||||||
// effect callback as 2nd argument - this is a source watcher
|
// effect callback as 2nd argument - this is a source watcher
|
||||||
return doWatch(effectOrSource, effectOrOptions, options)
|
return doWatch(effectOrSource, cbOrOptions, options)
|
||||||
} else {
|
} else {
|
||||||
// 2nd argument is either missing or an options object
|
// 2nd argument is either missing or an options object
|
||||||
// - this is a simple effect watcher
|
// - this is a simple effect watcher
|
||||||
return doWatch(effectOrSource, null, effectOrOptions)
|
return doWatch(effectOrSource, null, cbOrOptions)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user