angular-realworld-example-app icon indicating copy to clipboard operation
angular-realworld-example-app copied to clipboard

Missing subcriptions management on auth component

Open josecarballosa opened this issue 6 years ago • 1 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: https://github.com/gothinkster/angular-realworld-example-app/blob/7410c67bcd1bd24de0c736fcf43a2d4ff3a361ee/src/app/auth/auth.component.ts#L32

and also again few lines below: https://github.com/gothinkster/angular-realworld-example-app/blob/7410c67bcd1bd24de0c736fcf43a2d4ff3a361ee/src/app/auth/auth.component.ts#L51

josecarballosa avatar Jun 24 '19 15:06 josecarballosa

@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: https://github.com/gothinkster/angular-realworld-example-app/pull/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!

peterblazejewicz avatar Jul 10 '19 21:07 peterblazejewicz