Home:ALL Converter>complicated pipe chain with the HttpClient in Angular with RxJS

complicated pipe chain with the HttpClient in Angular with RxJS

Ask Time:2020-06-07T23:30:58         Author:Daniel

Json Formatter

I dont have a lot experience in RxJS and I want to do the following thing with a RxJS pipe in my Angular service.

I tried with the iif function but I simply have not enough experience in it.

Angular Version is: Angular 9
RxJS Version: 6.5.5

check response from GET request true via HttpClient
.... true -> check if can access website via HttpClient
................ true -> set this.isOnline = true
............................ get a response from another url via HttpClient
............................ true -> set this.result = responseFromUrl
........................................ end pipe
............................ false -> throwError("cant get result")
................ false -> set this.isOnline = false
............................. end pipe
.... false -> end pipe

Author:Daniel,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/62247638/complicated-pipe-chain-with-the-httpclient-in-angular-with-rxjs
yy