You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adev/src/content/guide/signals/effect.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Effects should be the last API you reach for. Always prefer `computed()` for der
19
19
TIP: There are no situations where effect is good, only situations where it is appropriate.
20
20
21
21
- Logging signal values, either for analytics or as a debugging tool.
22
-
- Keeping data in sync with different kind of storges`window.localStorage`, session storage, cookies etc.
22
+
- Keeping data in sync with different kind of storages:`window.localStorage`, session storage, cookies etc.
23
23
- Adding custom DOM behavior that can't be expressed with template syntax.
24
24
- Performing custom rendering to a `<canvas>` element, charting library, or other third party UI library.
25
25
@@ -68,11 +68,11 @@ export class EffectiveCounterComponent {
68
68
Angular implicitly defines two implicit behaviors for its effects depending on the context they were created in.
69
69
70
70
A "View Effect" is an `effect` created in the context of a component instantiation. This includes effects created by services that are tied to component injectors.<br>
71
-
A "Root Effect" is created in a root provided service.
71
+
A "Root Effect" is created in the context of a root provided service instantiation.
72
72
73
73
The execution of both kind of `effect` are tied to the change detection process.
74
74
75
-
- "View effects" are executed _before_ there corresponding compoent is checked the change detection process.
75
+
- "View effects" are executed _before_ there corresponding component is checked the change detection process.
76
76
- "Root effects" are executed prior to all components being checked by the change detection process.
77
77
78
78
In both cases, if at least one of the effect dependency changed during the effect execution, the effect will re-run before moving ahead on the change detection process,
@@ -136,9 +136,9 @@ export class MyFancyChart {
136
136
}
137
137
```
138
138
139
-
In this example `afterRenderEffect` to update a chart created by a 3rd party library.
139
+
In this example `afterRenderEffect`is used to update a chart created by a 3rd party library.
140
140
141
-
TIP: You often don't need `afterRenderEffect` to check for DOM changes. APIs like `ResizeObserver`, `MutationObserver` and `IntersectionObserver` are preferred to `effect` or afterRenderEffect when possible.
141
+
TIP: You often don't need `afterRenderEffect` to check for DOM changes. APIs like `ResizeObserver`, `MutationObserver` and `IntersectionObserver` are preferred to `effect` or `afterRenderEffect` when possible.
0 commit comments