Skip to content

Commit 06a09d2

Browse files
committed
docs(api): add warnRecursiveComputed config option
1 parent 78d61f2 commit 06a09d2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/api/application.md

+18
Original file line numberDiff line numberDiff line change
@@ -662,3 +662,21 @@ Force unhandled errors to be thrown in production mode.
662662
- 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.
663663
664664
By setting `app.config.throwUnhandledErrorInProduction` to `true`, unhandled errors will be thrown even in production mode.
665+
666+
667+
## app.config.warnRecursiveComputed <sup class="vt-badge" data-text="3.5+" /> {#app-config-warnrecursivecomputed}
668+
669+
Warn when a computed is recursively dependent on itself. Only works in development mode.
670+
671+
- **Type:** `boolean`
672+
673+
- **Default:** `false`
674+
675+
- **Details**
676+
677+
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.
678+
679+
By setting `app.config.warnRecursiveComputed` to `true` will warn when a computed is recursively dependent on itself in development mode.
680+
681+
- **See also** [Getters should be side-effect free](/guide/essentials/computed.html#getters-should-be-side-effect-free)
682+

0 commit comments

Comments
 (0)