Performance: Why component communication matters
MEDIUM IMPACT
Component communication affects how fast and smoothly data flows between parts of the app, impacting interaction speed and visual updates.
Use Angular signals or a shared service with RxJS observables to manage state and communicate efficiently between components.
Parent component uses multiple EventEmitters and @Input properties with frequent change detection cycles triggering many updates.
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| EventEmitters with default change detection | Many DOM updates | Multiple reflows per event | High paint cost due to frequent updates | [X] Bad |
| Signals or RxJS with OnPush change detection | Minimal DOM updates | Single or no reflows per event | Low paint cost with batched updates | [OK] Good |