gothinkster / angular-realworld-example-app

Exemplary real world application built with Angular

Home Page:https://angular.realworld.how/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing subcriptions management on auth component

josecarballosa opened this issue · comments

Could the missing subscription management on the auth component create some leaking problems? Is it OK to do it like this in a real-world app?

checkout this line:

this.route.url.subscribe(data => {

and also again few lines below:

@carballosa
Sometimes that is OK to not unsubscribe (where the source of the observable will relinquish the resource).
I've created a PR to put a context on this:
#153
The note here explains this:
https://angular.io/guide/router#observable-parammap-and-component-reuse
Also check Ben Lash comments from Ng Conf closing panel:
https://www.youtube.com/watch?v=PjHIqx0w4do
Cheers!