DEV Community

Discussion on: Handle async actions by the RxJS and Redux-observable

Collapse
 
joshpitzalis profile image
Josh

Why do you use .pipe twice? Why not handle the result of fromPromise(promise()) on the outer observable. If I understand correctly the point of switchMap and the other Map type operators is to merge the inner observable with the outer observable. In which case what is the advantage of processing the response from the process on the inner observable? Would it be cleaner to handle the sequence of events on the outer observable. I mean Isn't the whole point to try and avoid approaching callback hell? I'm just starting out with rxjs and responding to this query would be super helpful. Thank you for writing the article.