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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.