import { Effect , Actions , ofType } from '@ngrx/effects' ; import { Injectable } from '@angular/core' ; import { map } from 'rxjs/operators' ; import { MatDialog } from '@angular/material/dialog' ; import { CloseModalDialogsAction , AppActionTypes } from '../actions/app.actions' ; @ Injectable ( ) export class DialogEffects { constructor ( private actions$ , private matDialog ) { } @ Effect ( { dispatch : false } ) closeAll$ = this . actions$ . pipe ( ofType < CloseModalDialogsAction > ( AppActionTypes . CloseModalDialogs ) , map ( ( ) => this . matDialog . closeAll ( ) ) ) ; }