Currently I have a method that makes 2 separate calls to an API, each returns an observable and in the case that nothing is returned, the observable is set to EMPTY.
I'm currently trying to combine these returned observables and return the combined observable as an observable.
combinedObservables(items1[], items2[]): Observable<Spatial> {
obs1<Spatial> = iif(items1.length > 0 ? getObsList1 : Empty)
obs2<Spatial> = iif(items2.length > 0 ? getObsList2 : Empty)
return combineLatest([obs1, obs2])
The problem is this returns an observable of Spatial | Spatial, rather than just spatial. I tried using forkjoin but I don't think this would work in the case that one was empty as it needs each observable to emit a value
I expected combinelatest would simply combine both streams and return the two as one considering both observables are of the same type and the goal return type is also the same