Currently, I am dealing with two different types of Observables and my goal is to wait for both of them to emit at least once before immediately returning a promise of a third Observable with a different return type.
This is what I have so far:
return Observable.forkJoin([$A, $B])
.do(() => {
return $C;
})
.toPromise()
.then(result => result);
In this code snippet, $A
represents an Observable<AType>
, $B
represents an Observable<BType>
. However, the specific results of these observables are not important, I simply need to know when they have completed. After that, I want to convert $C
into a Promise<CType>
using toPromise
.
Despite my efforts, it seems like this implementation is not functioning as expected. It appears to be returning a Promise<Void[]>
or an Observable<Void[][]>
, but I am not entirely sure how to troubleshoot this issue. My assumption is that forkJoin is executing the first two promises and then correctly waiting for both to resolve, it's just the return type causing confusion.