Skip to content

Instantly share code, notes, and snippets.

@rafaelrozon
Last active May 26, 2019 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelrozon/83ccd86f1e2a77a839ad89b287f0f739 to your computer and use it in GitHub Desktop.
Save rafaelrozon/83ccd86f1e2a77a839ad89b287f0f739 to your computer and use it in GitHub Desktop.
// src/state/middlewares/composeEnhancers.js
import { composeWithDevTools } from 'redux-devtools-extension';
import { compose } from 'redux';
let composeEnhancers = compose;
if (process.env.NODE_ENV === 'development') {
composeEnhancers = composeWithDevTools
}
export default composeEnhancers;
// src/state/middlewares/index.js
import { applyMiddleware } from 'redux'
import thunk from 'redux-thunk';
import composeEnhancer from './composeEnhancer';
export default composeEnhancer(
applyMiddleware(
thunk
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment