Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add watchEffect notes #2596

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/api/reactivity-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ Takes an object (reactive or plain) or a [ref](#ref) and returns a readonly prox

Runs a function immediately while reactively tracking its dependencies and re-runs it whenever the dependencies are changed.

:::info Usage Note
`watchEffect` will execute immediately upon initialization. During this initial execution, `watchEffect` will collect dependencies accessed during the first run. When the dependencies change, `watchEffect` will be re-executed. In subsequent executions, `watchEffect` will only collect dependencies accessed in the previous run, thus avoiding unnecessary executions and improving performance.
:::
- **Type**

```ts
Expand Down