forked from NetanelBasal/ngrx-generator
-
Notifications
You must be signed in to change notification settings - Fork 5
Debugging
kmathy edited this page Jan 1, 2018
·
1 revision
You have two solutions:
- Use the meta-reducer
logger
(in app.store): This meta-reducer prints directly in the console of your browser. - Use StoreDevTool: You'll need to follow these instructions to use properly this tool
By default, logger is enabled.
If you want to disable the meta-reducer, you just need to remove logger
in app.store:
export const metaReducers: MetaReducer<State>[] = !environment.production
? [logger, storeFreeze] --> remove logger here
: [];
To re-enable, just add it in the array.
It uses a module, so in your StoreReduxorModule, just (un)comment the line importing the StoreDevTool:
@NgModule({
imports: [
HttpClientModule,
StoreModule.forRoot(reducers, { metaReducers }),
EffectsModule.forRoot([...AllEffects]),
StoreDevtoolsModule.instrument({ // (Un)comment here to disable/enable
maxAge: 25, // Retains last 25 states
})
],
...
})
export class StoreReduxorModule {
Pay attention to follow properly the instructions to use it