Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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