Skip to content

Commit c63ef9c

Browse files
jnizetalxhub
authored andcommitted
docs: fix typos and clarify root effect
1 parent 7674ada commit c63ef9c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

adev/src/content/guide/signals/effect.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Effects should be the last API you reach for. Always prefer `computed()` for der
1919
TIP: There are no situations where effect is good, only situations where it is appropriate.
2020

2121
- 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.
2323
- Adding custom DOM behavior that can't be expressed with template syntax.
2424
- Performing custom rendering to a `<canvas>` element, charting library, or other third party UI library.
2525

@@ -68,11 +68,11 @@ export class EffectiveCounterComponent {
6868
Angular implicitly defines two implicit behaviors for its effects depending on the context they were created in.
6969

7070
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.
7272

7373
The execution of both kind of `effect` are tied to the change detection process.
7474

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.
7676
- "Root effects" are executed prior to all components being checked by the change detection process.
7777

7878
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 {
136136
}
137137
```
138138

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.
140140

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.
142142

143143
### Render phases
144144

0 commit comments

Comments
 (0)