diff --git a/src/app/main/apps/contacts/sidebars/main/main.component.ts b/src/app/main/apps/contacts/sidebars/main/main.component.ts index d9b69540..3ce6db1e 100644 --- a/src/app/main/apps/contacts/sidebars/main/main.component.ts +++ b/src/app/main/apps/contacts/sidebars/main/main.component.ts @@ -51,7 +51,7 @@ export class ContactsMainSidebarComponent implements OnInit, OnDestroy /** * On destroy */ - ngOnDestroy() + ngOnDestroy(): void { // Unsubscribe from all subscriptions this._unsubscribeAll.next(); diff --git a/src/app/main/apps/mail-ngrx/store/effects/mails.effects.ts b/src/app/main/apps/mail-ngrx/store/effects/mails.effects.ts index e062e17f..3e3cddf1 100644 --- a/src/app/main/apps/mail-ngrx/store/effects/mails.effects.ts +++ b/src/app/main/apps/mail-ngrx/store/effects/mails.effects.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Action, Store } from '@ngrx/store'; +import { Action, select, Store } from '@ngrx/store'; import { Actions, Effect, ofType } from '@ngrx/effects'; import { Observable, of, forkJoin } from 'rxjs'; @@ -24,12 +24,14 @@ export class MailsEffect private store: Store ) { - this.store.select(getRouterState).subscribe(routerState => { - if ( routerState ) - { - this.routerState = routerState.state; - } - }); + this.store + .pipe(select(getRouterState)) + .subscribe(routerState => { + if ( routerState ) + { + this.routerState = routerState.state; + } + }); } /** @@ -101,11 +103,9 @@ export class MailsEffect .pipe( ofType(MailsActions.UPDATE_MAILS), exhaustMap((action) => { - return forkJoin( - action.payload.map(mail => this.mailService.updateMail(mail)), - () => { - return new MailsActions.UpdateMailsSuccess(); - }); + return forkJoin(action.payload.map(mail => this.mailService.updateMail(mail))).pipe(map(() => { + return new MailsActions.UpdateMailsSuccess(); + })); }) ); @@ -118,7 +118,7 @@ export class MailsEffect this.actions .pipe( ofType(MailsActions.SET_CURRENT_MAIL), - withLatestFrom(this.store.select(getMailsState)), + withLatestFrom(this.store.pipe(select(getMailsState))), map(([action, state]) => { return new MailsActions.SetCurrentMailSuccess(state.entities[action.payload]); }) @@ -135,7 +135,7 @@ export class MailsEffect this.actions .pipe( ofType(MailsActions.CHECK_CURRENT_MAIL), - withLatestFrom(this.store.select(getMailsState)), + withLatestFrom(this.store.pipe(select(getMailsState))), map(([action, state]) => { if ( !state.entities[this.routerState.params.mailId] ) @@ -200,7 +200,7 @@ export class MailsEffect .pipe( ofType(MailsActions.SET_FOLDER_ON_SELECTED_MAILS), withLatestFrom( - this.store.select(getMailsState)), + this.store.pipe(select(getMailsState))), map(([action, state]) => { const entities = {...state.entities}; let mailsToUpdate = []; @@ -227,7 +227,7 @@ export class MailsEffect this.actions .pipe( ofType(MailsActions.ADD_LABEL_ON_SELECTED_MAILS), - withLatestFrom(this.store.select(getMailsState)), + withLatestFrom(this.store.pipe(select(getMailsState))), map(([action, state]) => { const entities = {...state.entities};