Tutorial

Using the Redux DevTools with ngrx/store

Published on June 7, 2017
author

Alligator.io

Using the Redux DevTools with ngrx/store

While we believe that this content benefits our community, we have not yet thoroughly reviewed it. If you have any suggestions for improvements, please let us know by clicking the “report an issue“ button at the bottom of the tutorial.

The Redux DevTools extension is a very popular tool to visualize and perform actions on the Redux state tree of an application. Thankfully, it can also be used with Angular 2+ projects that use ngrx/store for state management, thanks to ngrx/store-devtools.

First install the Redux DevTools extension itself. If you’re using Chrome, the easiest is through the Chrome web store. And here for the Firefox version. With the extension installed, you’ll see a new tab in your browser’s DevTools available when you’re working in a Redux-powered app.

Then install @ngrx/store-devtools using Yarn or npm:

$ yarn add @ngrx/store-devtools

# or:
$ npm install @ngrx/store-devtools --save

Finally, in your app module, import StoreDevtoolsModule and add it to your NgModule’s imports:

app.module.ts
// ...

import { StoreModule } from '@ngrx/store';
import { todoReducer } from './reducers/todo.reducer';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';

The maxAge config is optional and helps limit the amount of actions kept in the DevTools.

✨ And that’s it! You’re ready to start using the Redux DevTools in your ngrx/store projects.

The Redux Devtools extension in action

You can skip actions, visualize actions and state or import/export the current state tree:

Redux Devtools action chart

You can even dispatch actions directly from the extension:

Dispatching an action

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products


About the authors
Default avatar
Alligator.io

author

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
1 Comments


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Using Angular 9 in July, 2020 my experience with this is that the Redux tab in Developer tools gave me the “store not found” dark grey screen until I configured the StoreDevtoolsModule like this in app.module.ts:

StoreDevtoolsModule.instrument({ maxAge: 25, // Retains last 25 states logOnly: environment.production, // Restrict extension to log-only mode }),

I know that this article says that setting those values is optional, but for me it was required just to get something basic working. It’s been 3 years since this article was published, so this may be part of the evolution of the tool.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel