I have a component that act as a sub-component of a big container component that orchestrates a slightly bigger form (using Reactive Forms)
I have this piece of code:
ngOnInit() {
this.subscriptions.push(this.form.get('total').valueChanges.subscribe(data => {
this.cdr.markForCheck();
}));
}
ngOnDestroy(): void {
this.subscriptions.forEach((sub) => {
sub.unsubscribe();
})
}
Question: is this required? Even if the component is destroyed alongside the form?