- Redux - Discussion
- Redux - Useful Resources
- Redux - Quick Guide
- Redux - React Example
- Redux - Integrate React
- Redux - Testing
- Redux - Devtools
- Redux - Middleware
- Redux - Reducers
- Redux - Pure Functions
- Redux - Actions
- Redux - Store
- Redux - Data Flow
- Redux - Core Concepts
- Redux - Installation
- Redux - Overview
- Redux - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Redux - Devtools
Redux-Devtools provide us debugging platform for Redux apps. It allows us to perform time-travel debugging and pve editing. Some of the features in official documentation are as follows −
It lets you inspect every state and action payload.
It lets you go back in time by “cancelpng” actions.
If you change the reducer code, each “staged” action will be re-evaluated.
If the reducers throw, we can identify the error and also during which action this happened.
With persistState() store enhancer, you can persist debug sessions across page reloads.
There are two variants of Redux dev-tools as given below −
Redux DevTools − It can be installed as a package and integrated into your apppcation as given below −
Redux DevTools Extension − A browser extension that implements the same developer tools for Redux is as follows −
Now let us check how we can skip actions and go back in time with the help of Redux dev tool. Following screenshots explain about the actions we have dispatched earper to get the psting of items. Here we can see the actions dispatched in the inspector tab. On the right, you can see the Demo tab which shows you the difference in the state tree.
You will get famipar with this tool when you start using it. You can dispatch an action without writing the actual code just from this Redux plugin tool. A Dispatcher option in the last row will help you with this. Let us check the last action where items are fetched successfully.
We received an array of objects as a response from the server. All the data is available to display psting on our page. You can also track the store’s state at the same time by cpcking on the state tab on the upper right side.
In the previous sections, we have learnt about time travel debugging. Let us now check how to skip one action and go back in time to analyze the state of our app. As you cpck on any action type, two options: ‘Jump’ and ‘Skip’ will appear.
By cpcking on the skip button on a certain action type, you can skip particular action. It acts as if the action never happened. When you cpck on jump button on certain action type, it will take you to the state when that action occurred and skip all the remaining actions in sequence. This way you will be able to retain the state when a particular action happened. This feature is useful in debugging and finding errors in the apppcation.
We skipped the last action, and all the psting data from background got vanished. It takes back to the time when data of the items has not arrived, and our app has no data to render on the page. It actually makes coding easy and debugging easier.
Advertisements