diff --git a/src/api/reactivity-core.md b/src/api/reactivity-core.md index ba0cb10f32..bcf67ccd8a 100644 --- a/src/api/reactivity-core.md +++ b/src/api/reactivity-core.md @@ -278,19 +278,6 @@ Runs a function immediately while reactively tracking its dependencies and re-ru // -> logs 1 ``` - Side effect cleanup: - - ```js - watchEffect(async (onCleanup) => { - const { response, cancel } = doAsyncWork(id.value) - // `cancel` will be called if `id` changes - // so that previous pending request will be cancelled - // if not yet completed - onCleanup(cancel) - data.value = await response - }) - ``` - Stopping the watcher: ```js @@ -528,7 +515,7 @@ Watches one or more reactive data sources and invokes a callback function when t Pausing / resuming the watcher: ```js - const { stop, pause, resume } = watchEffect(() => {}) + const { stop, pause, resume } = watch(() => {}) // temporarily pause the watcher pause()