combineLatest do in Angular RxJS?combineLatest waits for all input streams to emit at least once, then emits the latest values from each stream whenever any stream emits a new value.
forkJoin differ from combineLatest?forkJoin waits for all input streams to complete, then emits the last value from each stream as a single array and completes.
combineLatest instead of forkJoin?Use combineLatest when you want to react to every new value from any stream after all have emitted at least once, like live form inputs.
forkJoin?forkJoin will never emit or complete because it waits for all sources to complete.
combineLatest usage in Angular.combineLatest([obs1$, obs2$]).subscribe(([val1, val2]) => {
console.log(`Values: ${val1}, ${val2}`);
});combineLatest emit?combineLatest emits the latest values from all streams whenever any stream emits after all have emitted once.
forkJoin emit its combined values?forkJoin waits for all source Observables to complete, then emits the last values.
forkJoin?forkJoin waits for all to complete, so it hangs if one never completes.
combineLatest reacts to every new value after all streams emit once, ideal for live updates.
forkJoin emit if one source Observable errors?forkJoin errors immediately if any source Observable errors.
combineLatest works and when to use it.forkJoin and its typical use case.