Performance: combineLatest and forkJoin for combining
MEDIUM IMPACT
This affects how multiple asynchronous data streams are combined and how quickly the UI updates with combined results.
combineLatest([obs1, obs2, obs3]).subscribe(results => { /* update UI reactively */ });forkJoin([obs1, obs2, obs3]).subscribe(results => { /* update UI */ });| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| combineLatest | Multiple updates on each emission | Multiple reflows if UI changes | Higher paint cost due to frequent updates | [OK] |
| forkJoin | Single update after all complete | Single reflow | Lower paint cost with one update | [OK] Good |