Angular Async Pipe – Unsubscribe (Best Practices 2)

Use async pipe or unsubscribe properly. For example if you ignite a http get request by visiting X component and then route to Y component without waiting your get request to complete, your get request in X component still runs. There are several ways to handle that issue. First one is, using async pipe. Async […]

Angular 9 Subscribe in Subscribe (Best Practices 1)

In some cases, for example you may need to get userId from httpclient request then use that userId in another client request. Well, if you’re a beginner you will think about to handle it in subscribe in subscribe. Do not use subscribe in subscribe. Use mergeMap instead. Here is my model file including Todo and […]