So, I have a component like
class DialogLoginComponent {
constructor(
private dialogRef: MatDialogRef<DialogLoginComponent>,
private store: Store<Auth.State>
) {}
onDoSomething(): void {
this.dialogRef.close();
this.dialogRef.afterClosed().subscribe(() =>
this.store.dispatch(new RegistrationActions.OpenRegistrationDialog())
);
}
}
The question is, once the component gets destroyed, does the subscription get to still live or is Angular / RxJS smart enough to unsubscribe it automatically?