In the below snippet, when conditions are valid both the observable requests are polled for specified interval. But when first switchMap returns 'empty' conditionally, the polling gets cancelled and the second switchMap is not getting executed for the poll thread.
let pollingRequests = interval(10000).pipe(startWith(0),
switchMap(() => {
return condition ? validObservable: empty;
}),
switchMap(() => {
return condition ? validObservable: empty;
}),
);
Be aware that "EMPTY" in RxJs will just "Complete" the stream, without emiting something.
As a result if the first switchMap COMPLETES, it will send the complete signal down the stream. COMPLETE ist not a "normal" emit, therefor the second switchMap will not even be triggered. And with that the whole stream gets completed and the timer is dead.
So, depending on what you want to achieve, you can change for example to use combineLatest, then both "child"observables will be subscribed together (and emit their values "together") and if one completes, then each emit from the other will be combined with the last successful emit of the completed.
But the "solution" is very depending on what you want to achieve.