In rxjs I want to make a condition over multiple flatmap so I don't execute the second and third flatmap and I go directly to the subscribe :
this.authenticationAPI.getUser()
.flatmap(response1 => if(response1 != null) // I want to go directly to subscribe
.flatmap(response2 => return observable2(response2))
.flatmap(response3 => return observable3(response3))
.subscribe(response 4 => console.log(response4));
I thought about passing null observables to the second and third flatmap but is there any other solution?