Skip to content

Instantly share code, notes, and snippets.

@KarolinaCzo
Created August 1, 2018 09:23
Show Gist options
  • Save KarolinaCzo/b0cc138637d28c0f372543b1fff13cb5 to your computer and use it in GitHub Desktop.
Save KarolinaCzo/b0cc138637d28c0f372543b1fff13cb5 to your computer and use it in GitHub Desktop.
Add ngrx/store-devtools
More infor here: https://github.com/ngrx/platform/blob/master/docs/store-devtools/README.md
Instructions can be found here:
https://github.com/ngrx/platform/blob/master/docs/store-devtools/README.md
1) install through npm:
npm install @ngrx/store-devtools --save
2) Download the Redux Devtools Extension:
https://github.com/zalmoxisus/redux-devtools-extension/
3) In 'app.module.ts' import the devtools module:
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { environment } from '../environments/environment'; // Angular CLI environemnt
4) In 'app.module.ts' add this to NgModule:
@NgModule({
imports: [
StoreModule.forRoot(reducers),
// Instrumentation must be imported after importing StoreModule (config is optional)
StoreDevtoolsModule.instrument({
maxAge: 25, // Retains last 25 states
logOnly: environment.production, // Restrict extension to log-only mode
}),
],
})
5) Click on the Redux DevTools (right upper corner of your browser) and see if the store works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment