Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/api/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,8 @@ Configure a prefix for all IDs generated via [useId()](/api/composition-api-help

```js
// in a component:
const id1 = useId() // 'myApp:0'
const id2 = useId() // 'myApp:1'
const id1 = useId() // 'myApp-0'
const id2 = useId() // 'myApp-1'
```

## app.config.throwUnhandledErrorInProduction <sup class="vt-badge" data-text="3.5+" /> {#app-config-throwunhandlederrorinproduction}
Expand Down
6 changes: 3 additions & 3 deletions src/api/reactivity-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Runs a function immediately while reactively tracking its dependencies and re-ru

```js
watchEffect(async (onCleanup) => {
const { response, cancel } = doAsyncWork(newId)
const { response, cancel } = doAsyncWork(id.value)
// `cancel` will be called if `id` changes, cancelling
// the previous request if it hasn't completed yet
onCleanup(cancel)
Expand All @@ -320,7 +320,7 @@ Runs a function immediately while reactively tracking its dependencies and re-ru
import { onWatcherCleanup } from 'vue'

watchEffect(async () => {
const { response, cancel } = doAsyncWork(newId)
const { response, cancel } = doAsyncWork(id.value)
// `cancel` will be called if `id` changes, cancelling
// the previous request if it hasn't completed yet
onWatcherCleanup(cancel)
Expand Down Expand Up @@ -513,7 +513,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 } = watch(() => {})
const { stop, pause, resume } = watch(source, callback)

// temporarily pause the watcher
pause()
Expand Down
2 changes: 1 addition & 1 deletion src/api/reactivity-utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Converts a reactive object to a plain object where each property of the resultin
[K in keyof T]: ToRef<T[K]>
}

type ToRef = T extends Ref ? T : Ref<T>
type ToRef<T> = T extends Ref ? T : Ref<T>
```

- **Example**
Expand Down
4 changes: 4 additions & 0 deletions src/guide/extras/reactivity-in-depth.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ const plusOne = computed(() => count.value + 1, {
// access plusOne, should trigger onTrack
console.log(plusOne.value)

// onTrigger is only called while plusOne has a subscriber,
// such as a watcher or a component that renders it
watchEffect(() => plusOne.value)

// mutate count.value, should trigger onTrigger
count.value++
```
Expand Down