Skip to content

Daniele Ghidoli

Angular Tips & Tricks

  • About me
  • My Nomad Life

Category: RxJS

When should I unsubscribe from an Observable in Angular?
Posted on October 30, 2020October 30, 2020

When should I unsubscribe from an Observable in Angular?

You have probably heard many times that it’s a good practice to unsubscribe from an Observable after you subscribe to it in your Angular application. But is it always the case? Do you really need to do it?

Angular: How to prevent duplicated HTTP requests
Posted on October 28, 2020October 28, 2020

Angular: How to prevent duplicated HTTP requests

What happens if two different components call the same service which makes an HTTP call to an API? You will have two duplicated calls! Is it possible to share the first response with all subscribers to prevent duplicate HTTP requests? Yes, it is! Let’s see how.

How to load an Angular app just after the user is logged
Posted on October 28, 2020October 28, 2020

How to load an Angular app just after the user is logged

Whichever authentication method you use for logging in users in your Angular application, there will always be a problem to solve: starting your app and initialize views and components only after the user info is fully loaded. Let’s see how to do it!

How to subscribe to RxJS event after it has been already emitted
Posted on September 11, 2017

How to subscribe to RxJS event after it has been already emitted

Observables, Subjects and EventEmitters are amazing, I love them. But they have a common problem: what if you subscribe to one of them when the event has been already emitted? You would lose it!

Combining multiple Http streams with RxJS Observables in Angular
Posted on October 22, 2016October 27, 2020

Combining multiple Http streams with RxJS Observables in Angular

RxJS Observables, compared to the old Promises in Angular 1, seem to be more complicated to understand, but they are far more flexible. Let’s see how we can combine and chain them, in order to merge multiple Http streams of data and get what we need.

Menu

  • About me
  • My Nomad Life
  • Twitter
  • Github
  • Facebook
  • Instagram
  • Linkedin
  • Medium

Search a post

Categories

  • Bugs
  • i18n
  • RxJS
  • Testing

Most viewed

  • Angular: How to prevent duplicated HTTP requests
  • Testing an Angular Component with Mock Services
  • Combining multiple Http streams with RxJS Observables in Angular
  • How to subscribe to RxJS event after it has been already emitted
  • When should I unsubscribe from an Observable in Angular?
  • Why my Angular service doesn't return the assigned value?
  • How to load an Angular app just after the user is logged
  • Angular 2 internationalization explained: i18n + Angular CLI + AOT

Follow me on Twitter

My Tweets
© Daniele Ghidoli