Skip to content

Commit

Permalink
docs: fixes in 3.5 updates on reactivity-api page (#3016)
Browse files Browse the repository at this point in the history
  • Loading branch information
AloisSeckar authored Sep 16, 2024
1 parent e20eb77 commit 27dd985
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/api/reactivity-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -528,7 +515,7 @@ Watches one or more reactive data sources and invokes a callback function when t
Pausing / resuming the watcher: <sup class="vt-badge" data-text="3.5+" />
```js
const { stop, pause, resume } = watchEffect(() => {})
const { stop, pause, resume } = watch(() => {})

// temporarily pause the watcher
pause()
Expand Down

0 comments on commit 27dd985

Please sign in to comment.