refactor: remove optional chaining
This commit is contained in:
parent
334e72eeee
commit
5a0a2bfa9b
|
@ -215,13 +215,13 @@ export function baseWatch(
|
||||||
const _cb = cb
|
const _cb = cb
|
||||||
cb = (...args) => {
|
cb = (...args) => {
|
||||||
_cb(...args)
|
_cb(...args)
|
||||||
effect?.stop()
|
effect.stop()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const _getter = getter
|
const _getter = getter
|
||||||
getter = () => {
|
getter = () => {
|
||||||
_getter()
|
_getter()
|
||||||
effect?.stop()
|
effect.stop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -842,7 +842,9 @@ export function createWatcher(
|
||||||
const options: WatchOptions = {}
|
const options: WatchOptions = {}
|
||||||
if (__COMPAT__) {
|
if (__COMPAT__) {
|
||||||
const instance =
|
const instance =
|
||||||
getCurrentScope() === currentInstance?.scope ? currentInstance : null
|
currentInstance && getCurrentScope() === currentInstance.scope
|
||||||
|
? currentInstance
|
||||||
|
: null
|
||||||
|
|
||||||
const newValue = getter()
|
const newValue = getter()
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in New Issue