import { Injectable } from '@angular/core' ; import { map , filter , switchMap , mergeMap , take } from 'rxjs/operators' ; import { Effect , Actions , ofType } from '@ngrx/effects' ; import { ApplicationSettingsActions } from '../actions' ; import { Category , RouterStateUrl } from '../../../shared/model' ; import { ApplicationSettingsService } from '../../services' ; import { ROUTER_NAVIGATION } from '@ngrx/router-store' ; import { Store } from '@ngrx/store' ; import { CoreState , coreState } from '../reducers' ; @ Injectable ( ) export class ApplicationSettingsEffects { @ Effect ( ) loadApplicationSettings$ = this . actions$ . pipe ( ofType ( ApplicationSettingsActions . LOAD_APPLICATION_SETTINGS ) ) . pipe ( switchMap ( ( ) => { return this . svc . getApplicationSettings ( ) . pipe ( map ( ( applicationSettings ) => { return this . applicationSettingsActions . loadApplicationSettingsSuccess ( applicationSettings ) ; } ) ) ; } ) ) ; constructor ( private actions$ , private applicationSettingsActions , private svc ) { } }