Skip to content

Commit dab4809

Browse files
committed
docs: remove duplicated example for watchEffect
1 parent 6fcf44c commit dab4809

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/api/reactivity-core.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -278,19 +278,6 @@ Runs a function immediately while reactively tracking its dependencies and re-ru
278278
// -> logs 1
279279
```
280280
281-
Side effect cleanup:
282-
283-
```js
284-
watchEffect(async (onCleanup) => {
285-
const { response, cancel } = doAsyncWork(id.value)
286-
// `cancel` will be called if `id` changes
287-
// so that previous pending request will be cancelled
288-
// if not yet completed
289-
onCleanup(cancel)
290-
data.value = await response
291-
})
292-
```
293-
294281
Stopping the watcher:
295282
296283
```js

0 commit comments

Comments
 (0)