fuse-angular/src/app/store/store.module.ts
2018-05-20 10:12:31 +03:00

33 lines
972 B
TypeScript

import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { EffectsModule } from '@ngrx/effects';
import { MetaReducer, StoreModule } from '@ngrx/store';
import { NgModule } from '@angular/core';
import { storeFreeze } from 'ngrx-store-freeze';
import { RouterStateSerializer, StoreRouterConnectingModule } from '@ngrx/router-store';
import { environment } from 'environments/environment';
import { reducers, effects, CustomSerializer } from 'app/store';
export const metaReducers: MetaReducer<any>[] = !environment.production
? [storeFreeze]
: [];
@NgModule({
imports : [
StoreModule.forRoot(reducers, {metaReducers}),
EffectsModule.forRoot(effects),
!environment.production ? StoreDevtoolsModule.instrument() : [],
StoreRouterConnectingModule
],
providers: [
{
provide : RouterStateSerializer,
useClass: CustomSerializer
}
]
})
export class AppStoreModule
{
}