feat(runtime-core): add watchEffect API
BREAKING CHANGE: replae `watch(fn, options?)` with `watchEffect`
The `watch(fn, options?)` signature has been replaced by the new
`watchEffect` API, which has the same usage and behavior. `watch`
now only supports the `watch(source, cb, options?)` signautre.
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
nextTick,
|
||||
onMounted,
|
||||
watch,
|
||||
watchEffect,
|
||||
onUnmounted,
|
||||
onErrorCaptured
|
||||
} from '@vue/runtime-test'
|
||||
@@ -163,7 +164,7 @@ describe('Suspense', () => {
|
||||
// extra tick needed for Node 12+
|
||||
deps.push(p.then(() => Promise.resolve()))
|
||||
|
||||
watch(() => {
|
||||
watchEffect(() => {
|
||||
calls.push('immediate effect')
|
||||
})
|
||||
|
||||
@@ -265,7 +266,7 @@ describe('Suspense', () => {
|
||||
const p = new Promise(r => setTimeout(r, 1))
|
||||
deps.push(p)
|
||||
|
||||
watch(() => {
|
||||
watchEffect(() => {
|
||||
calls.push('immediate effect')
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user