Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: #91 fix onDestroy subscriptions
  • Loading branch information
macrisguncay committed Apr 22, 2020
commit b9899901d3657172ef9c8cb775149ba2d1f7ee54
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ export class CreateProjectComponent implements OnInit, OnDestroy {
}

ngOnInit() {
const projectToEditSubscription = this.store.pipe(select(getProjectToEdit));
projectToEditSubscription.subscribe((project) => {
const projectToEdit$ = this.store.pipe(select(getProjectToEdit));
this.projectToEditSubscription = projectToEdit$.subscribe((project) => {
this.projectToEdit = project;
this.setDataToUpdate(this.projectToEdit);
});

const projectTypesSubscription = this.projectTypeStore.pipe(select(allProjectTypes));
projectTypesSubscription.subscribe((projectsType) => {
const projectsTypes$ = this.projectTypeStore.pipe(select(allProjectTypes));
this.projectTypesSubscription = projectsTypes$.subscribe((projectsType) => {
this.projectsTypes = projectsType;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class ProjectListComponent implements OnInit, OnDestroy {

ngOnInit(): void {
this.store.dispatch(new actions.LoadProjects());
const projectsSubscription = this.store.pipe(select(allProjects));
projectsSubscription.subscribe((response) => {
const projects$ = this.store.pipe(select(allProjects));
this.projectsSubscription = projects$.subscribe((response) => {
this.isLoading = response.isLoading;
this.projects = response.projectList;
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/shared/models/project.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export interface Project {
customer_id?: string;
name: string;
description?: string;
project_type_id: string;
project_type_id?: string;
}