1. 23
    Using the Redux DevTool Support Built-in to Redux Toolkit
    1m 58s

Using the Redux DevTool Support Built-in to Redux Toolkit

Jamund Ferguson
InstructorJamund Ferguson
Share this video with your friends

Social Share Links

Send Tweet
Published 3 years ago
Updated 3 years ago

In this lesson we install the Redux Dev Tools extension into Chrome and demonstrate how it lets you inspect the various actions passing through your redux store as well as all of the data it contains. We also briefly demonstrate the time travel debugging capability as we walk back through and un-add items to our shopping cart.

The key here is that because we used configureStore from RTK which automatically includes support for redux dev tool without having to explicitly turn it on.

Jamund Ferguson: [0:00] In your web browser, go to the GitHub page for the redux-devtools-extension. On the page, scroll down until you see the section on Installation for various web browsers. I'm using Chrome, so I'm going to click the link to the Chrome Web Store. From here, you need to click Add to Chrome, and then Add Extension.

[0:15] Once that's installed, you'll see a small logo in the upper right-hand corner of your browser. You can also access it by clicking on the Extensions button if needed, or you can find it in your context menu when you right-click on the page.

[0:26] Back in our shopping cart, if I right-click and dock our Redux DevTools to the right, click on the Products page, you're going to see an action being fired into Redux products/receivedProducts. If you click into the Action, you can see exactly what the payload was, all the products that were sent into the Redux store, and you can also see the state of Redux after that action was processed.

[0:45] If I add some things into the cart, you can see those actions showing up in our DevTools window. If I go into the cart, remove them, or update the quantity, those actions appear as well.

[0:56] When I click checkout, you'll see our pending action followed by our fulfilled action being fired off from our thunk, and if you're ever curious and you want to go backwards, you can do two things. You can click on a specific action that was fired previously and look at the state when that action was fired.

[1:11] For example, if I open up the items in the tree down here, as I click through different addToCart actions, you can see it growing, which is really cool, or if I start from the most recent action, I can click the arrow and go backward. It immediately updates the browser to show the historical state. This feature is called time travel debugging.

[1:28] A lot of people say it's kind of a gimmick, but I've found that helpful to see what actions led me to a certain state in my application.

[1:36] The Redux DevTools is also really nice because it can help you see when you may be firing off too many Redux actions in your application. If this DevTools window becomes so full of actions you can't even tell what's happening, it may be time to rethink how you're dispatching actions into your Redux store.

[1:51] Overall, this is a great tool and with RTK it comes built in. All you have to do is install it into your browser and you can start using it immediately.

egghead
egghead
~ an hour ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today