Skip to content

Commit b989990

Browse files
committed
fix: #91 fix onDestroy subscriptions
1 parent d683ce2 commit b989990

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/app/modules/customer-management/components/projects/components/create-project/create-project.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ export class CreateProjectComponent implements OnInit, OnDestroy {
3434
}
3535

3636
ngOnInit() {
37-
const projectToEditSubscription = this.store.pipe(select(getProjectToEdit));
38-
projectToEditSubscription.subscribe((project) => {
37+
const projectToEdit$ = this.store.pipe(select(getProjectToEdit));
38+
this.projectToEditSubscription = projectToEdit$.subscribe((project) => {
3939
this.projectToEdit = project;
4040
this.setDataToUpdate(this.projectToEdit);
4141
});
4242

43-
const projectTypesSubscription = this.projectTypeStore.pipe(select(allProjectTypes));
44-
projectTypesSubscription.subscribe((projectsType) => {
43+
const projectsTypes$ = this.projectTypeStore.pipe(select(allProjectTypes));
44+
this.projectTypesSubscription = projectsTypes$.subscribe((projectsType) => {
4545
this.projectsTypes = projectsType;
4646
});
4747
}

src/app/modules/customer-management/components/projects/components/project-list/project-list.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export class ProjectListComponent implements OnInit, OnDestroy {
2525

2626
ngOnInit(): void {
2727
this.store.dispatch(new actions.LoadProjects());
28-
const projectsSubscription = this.store.pipe(select(allProjects));
29-
projectsSubscription.subscribe((response) => {
28+
const projects$ = this.store.pipe(select(allProjects));
29+
this.projectsSubscription = projects$.subscribe((response) => {
3030
this.isLoading = response.isLoading;
3131
this.projects = response.projectList;
3232
});

src/app/modules/shared/models/project.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ export interface Project {
33
customer_id?: string;
44
name: string;
55
description?: string;
6-
project_type_id: string;
6+
project_type_id?: string;
77
}

0 commit comments

Comments
 (0)