Skip to content

Instantly share code, notes, and snippets.

@mladenoff
Last active September 20, 2017 04:11
Show Gist options
  • Save mladenoff/5ebd54edcab45ab13ab470cf48bfc2f9 to your computer and use it in GitHub Desktop.
Save mladenoff/5ebd54edcab45ab13ab470cf48bfc2f9 to your computer and use it in GitHub Desktop.
Redux Dev Tool setup

Redux Dev Tools setup

The actual instructions for the Redux Dev Tools are overly complex and obtuse for 99% of what you will need. This will get you all set-up with one Chrome extension, one package installation, and just one additional line of code.

Set these up, you will be glad you did.

Instructions

First, install the Chrome extension.

Next, nstall the node package onto your project.

~/full-stack$ npm install --save-dev redux-devtools-extension

Lastly make the following changes to your /frontend/store/store.js.

  // frontend/store/store.js

  import { createStore, applyMiddleware } from 'redux';
  import thunk from 'redux-thunk';
  import logger from 'redux-logger';
+ import { composeWithDevTools } from 'redux-devtools-extension';

  import rootReducer from '../reducers/root_reducer';

  const configureStore = (preloadedState = {}) => (
    createStore(
      rootReducer,
      preloadedState,
+     composeWithDevTools(applyMiddleware(thunk, logger))
-     applyMiddleware(thunk, logger)
    )
  );

  export default configureStore;

Great job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment