Angular 2: why use switchMap when retrieving route params?
switchMap is usually used when you have some async operation that is triggered by some prepended “event/stream”. The difference to e.g. flatMap or concatMap is, that as soon as the next trigger emits, the current async operation is canceled and re-triggered. In your case this means, that as soon as the route-params change, your hero-service … Read more