I have a function that does something like the following:
async foo() {
await doSomething();
return getObservableFromSomewhereElse();
}
The problem is that the await
makes the signature a Promise<Observable<T>>
. Because I'm already returning an Observable, I'd just like to fold the Promise into the Observable so that the signature is Observable<T>
.
Note: doSomething()
must occur before getObservableFromSomewhereElse()
.
I think Observable.defer()
might help with this but I'm not certain.
Any ideas on how to make this function just return Observable<T>
?