In my Angular application with Redux, I am utilizing the @select() method to retrieve an object named 'sectionAll'. This object serves as the data source for a table that I am displaying, requiring me to pass it to the dataSource in the controller.
Within the constructor, I am subscribing to the 'sectionAll' observable.
My concern is whether using @select() in this manner will also handle the destruction of that subscription or if I am misunderstanding the usage of @select().
Edit:
I am leveraging @angular-redux/store with Angular 6.
Here is my constructor:
constructor(
private adalService: AdalService,
private service: DeliveriesService,
private ngRedux: NgRedux<IAppState>
) {
this.service.getSectionAll();
this.sectionAll.subscribe(data => {
(this.dataSource = new MatTableDataSource(data)),
(this.dataSource.sort = this.sort);
});
}
Regarding the @select part:
@select() sectionAll;