I\'m trying to user forkJoin
on two Observables. One of them starts as a stream... If I subscribe to them directly I get a response, forkJoin
isn\'
forkJoin
emits only when all inner observables have completed.
If you need an equivalent of forkJoin
that just listens to a single emission from each source, use combineLatest
+ take(1)
combineLatest(
this.statuses$,
this.companies$,
)
.pipe(
take(1),
)
.subscribe(([statuses, companies]) => {
console.log('forkjoin');
this._countStatus(statuses, companies);
});
As soon as both sources emit, combineLatest
will emit and take(1)
will unsubscribe immediately after that.