Skip to content

Commit dae18b9

Browse files
authored
docs: Update computed.md to better highlight what not to do (#1758)
1 parent 98b7484 commit dae18b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/guide/essentials/computed.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ Now when you run `fullName.value = 'John Doe'`, the setter will be invoked and `
263263

264264
### Getters should be side-effect free
265265

266-
It is important to remember that computed getter functions should only perform pure computation and be free of side effects. For example, don't make async requests or mutate the DOM inside a computed getter! Think of a computed property as declaratively describing how to derive a value based on other values - its only responsibility should be computing and returning that value. Later in the guide we will discuss how we can perform side effects in reaction to state changes with [watchers](./watchers).
266+
It is important to remember that computed getter functions should only perform pure computation and be free of side effects. For example, **don't make async requests or mutate the DOM inside a computed getter!** Think of a computed property as declaratively describing how to derive a value based on other values - its only responsibility should be computing and returning that value. Later in the guide we will discuss how we can perform side effects in reaction to state changes with [watchers](./watchers).
267267

268268
### Avoid mutating computed value
269269

0 commit comments

Comments
 (0)