import { NgModule , ModuleWithProviders } from '@angular/core' ; import { StoreModule } from '@ngrx/store' ; import { EffectsModule } from '@ngrx/effects' ; import { AppReducers , metaReducers } from './reducers' ; import { StoreDevtoolsModule } from '@ngrx/store-devtools' ; import { environment } from '@env/environment' ; import { ErrorsEffects } from './effects/err.effect' ; const providers = [ ] ; const effects = [ ErrorsEffects ] ; @ NgModule ( { declarations : [ ] , imports : [ StoreModule . forRoot ( AppReducers , { metaReducers } ) , EffectsModule . forRoot ( [ ... effects ] ) , ! environment . production ? StoreDevtoolsModule . instrument ( ) : [ ] ] } ) export class NgRxStoreModule { static forRoot ( ) { return { ngModule : NgRxStoreModule , providers : [ ... ( ! environment . production ? providers : [ ] ) , ... effects ] } ; } }