Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@redux-devtools/extension

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redux-devtools/extension

Wrappers for Redux DevTools Extension.

  • 3.0.0-rc.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is @redux-devtools/extension?

@redux-devtools/extension is a package that provides integration with Redux DevTools, a powerful tool for debugging and visualizing the state changes in a Redux application. It allows developers to inspect every action and state change, time travel through states, and even persist states across sessions.

What are @redux-devtools/extension's main functionalities?

Integration with Redux DevTools

This feature allows you to integrate your Redux store with the Redux DevTools extension. By using `composeWithDevTools`, you can enhance your store with DevTools capabilities, making it easier to debug and visualize state changes.

import { createStore } from 'redux';
import { composeWithDevTools } from '@redux-devtools/extension';

const reducer = (state = {}, action) => {
  switch (action.type) {
    case 'INCREMENT':
      return { ...state, count: state.count + 1 };
    default:
      return state;
  }
};

const store = createStore(reducer, composeWithDevTools());

Custom Action Sanitation

This feature allows you to sanitize actions before they are sent to the DevTools. In this example, the `actionSanitizer` function modifies the action type for 'INCREMENT' actions to include '(sanitized)'.

import { createStore } from 'redux';
import { composeWithDevTools } from '@redux-devtools/extension';

const reducer = (state = {}, action) => {
  switch (action.type) {
    case 'INCREMENT':
      return { ...state, count: state.count + 1 };
    default:
      return state;
  }
};

const store = createStore(reducer, composeWithDevTools({
  actionSanitizer: (action) => action.type === 'INCREMENT' ? { ...action, type: 'INCREMENT (sanitized)' } : action
}));

State Serialization

This feature enables state serialization, which is useful for persisting and rehydrating state across sessions. By setting `serialize` to true, the state and actions are serialized before being sent to the DevTools.

import { createStore } from 'redux';
import { composeWithDevTools } from '@redux-devtools/extension';

const reducer = (state = {}, action) => {
  switch (action.type) {
    case 'INCREMENT':
      return { ...state, count: state.count + 1 };
    default:
      return state;
  }
};

const store = createStore(reducer, composeWithDevTools({
  serialize: true
}));

Other packages similar to @redux-devtools/extension

FAQs

Package last updated on 06 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc