Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} from './store/reducers/router.reducer';
import { ROUTING_FEATURE } from './store/routing-state';
export function initConfigurableRoutes(
service: ConfigurableRoutesService
): () => void {
const result = () => service.init(); // workaround for AOT compilation (see https://stackoverflow.com/a/51977115)
return result;
}
@NgModule({
imports: [
StoreModule.forFeature(ROUTING_FEATURE, reducerToken),
EffectsModule.forFeature(effects),
StoreRouterConnectingModule.forRoot({
routerState: RouterState.Minimal,
stateKey: ROUTING_FEATURE, // name of reducer key
}),
],
})
export class RoutingModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: RoutingModule,
providers: [
reducerProvider,
{
provide: RouterStateSerializer,
useClass: CustomSerializer,
},
{
provide: APP_INITIALIZER,
*/
StoreModule.forRoot(ROOT_REDUCERS, {
metaReducers,
runtimeChecks: {
strictStateImmutability: true,
strictActionImmutability: true,
strictStateSerializability: true,
strictActionSerializability: true,
},
}),
/**
* @ngrx/router-store keeps router state up-to-date in the store.
*/
StoreRouterConnectingModule.forRoot({
routerState: RouterState.Minimal,
}),
/**
* Store devtools instrument the store retaining past versions of state
* and recalculating new states. This enables powerful time-travel
* debugging.
*
* To use the debugger, install the Redux Devtools extension for either
* Chrome or Firefox
*
* See: https://github.com/zalmoxisus/redux-devtools-extension
*/
StoreDevtoolsModule.instrument({
name: 'NgRx Book Store App',
// In a production build you would want to disable the Store Devtools
MatToolbarModule,
AuthModule.forRoot(),
StoreModule.forRoot(reducers, {
metaReducers,
runtimeChecks : {
strictStateImmutability: true,
strictActionImmutability: true,
strictActionSerializability: true,
strictStateSerializability:true
}
}),
StoreDevtoolsModule.instrument({maxAge: 25, logOnly: environment.production}),
EffectsModule.forRoot([]),
StoreRouterConnectingModule.forRoot({
stateKey: 'router',
routerState: RouterState.Minimal
})
],
bootstrap: [AppComponent]
})
export class AppModule {
}
LayoutModule,
CartModule,
StoreModule.forRoot(
{},
{
metaReducers: !environment.production ? [] : [],
runtimeChecks: {
strictStateImmutability: true,
strictActionImmutability: true
}
}
),
EffectsModule.forRoot([]),
!environment.production ? StoreDevtoolsModule.instrument() : [],
StoreRouterConnectingModule.forRoot({
routerState: RouterState.Minimal
})
],
bootstrap: [AppComponent]
})
export class AppModule {}