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(api): add warnRecursiveComputed config option #3072

Open
wants to merge 1 commit 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/api/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -662,3 +662,21 @@ Force unhandled errors to be thrown in production mode.
- In production, the error will only be logged to the console to minimize the impact to end users. However, this may prevent errors that only happen in production from being caught by error monitoring services.

By setting `app.config.throwUnhandledErrorInProduction` to `true`, unhandled errors will be thrown even in production mode.


## app.config.warnRecursiveComputed <sup class="vt-badge" data-text="3.5+" /> {#app-config-warnrecursivecomputed}

Warn when a computed is recursively dependent on itself. Only works in development mode.

- **Type:** `boolean`

- **Default:** `false`

- **Details**

The result of a computed is based on its reactive dependencies. However, in certain cases, the computed getter function may indirectly or directly mutate the state it depends on, causing the computed to recursively depend on itself, which leads to a recursive call.

By setting `app.config.warnRecursiveComputed` to `true` will warn when a computed is recursively dependent on itself in development mode.

- **See also** [Getters should be side-effect free](/guide/essentials/computed.html#getters-should-be-side-effect-free)