I have this:
$someObserver
.subscribe(foo => {
if(foo === "Bar" ) {/*Do A*/}
else {/*Do B*/}
});
It works. What I want: achieving the same but without conditions and with more RxJS style.
Is there something to do it RxJS style?
I know ‘partition’ but i dont like it. I would prefer to the separation within the stream. Something like:
$someObserver.pipe(
split(foo => foo === 'bar')
tap([streamA, stream] => {
streamA.subscribe(tap(x => /*doA*/);
streamB.subscribe(x => /* doB */) ;
})).subscribe();
Does something like this exists?
Thanks!