If a developer uses Angular without knowing the power of RxJS the code can turn into a huge mass very fast.
When the inner observable needs a value from the outer observable, we can and must use mergeMap!
As a result, we not just gonna have nicer and more readable code, but we can follow the async pipe pattern.
It has also performance advantages if the outer event triggers twice then the first execution will be canceled.
With mergeMap
Without mergeMap
I am a Full-stack [Angular, Java] contractor/freelancer developer, if you would like to contact me here is my website !
You can find me on LinkedIn as well.
Top comments (0)