Given a switchMap like this
const sw = switchMap(() => {
if (/*some condition*/) { return this.getDetails().pipe(...) }
return this.getOtherDetails().pipe(....);
});
Ideally I would like to use this, for example as follows
from(sw).subscribe(....)
but that doesn't work :)
So how can I do this. I can think of one solution
of(true).pipe(sw).subscribe(...)
But this doesn't feel right, or does it? I can image RxJS has a much better solution for this kind of problem. Any suggestions?