import {
  applyMiddleware,
  combineReducers,
  createStore,
} from 'redux';
import thunk from 'redux-thunk';
import enhancer from './storeEnhancer';
import { composeWithDevTools } from 'redux-devtools-extension';

export default (preloadedState, preloadedReducers) => createStore(
  preloadedReducers ? combineReducers(preloadedReducers) : () => ({}),
  preloadedState,
  composeWithDevTools(
    applyMiddleware(thunk),
    enhancer(preloadedReducers),
  ),
);

import {
  applyMiddleware,
  combineReducers,
  createStore,
} from 'redux';
import thunk from 'redux-thunk';
import enhancer from './storeEnhancer';
import { composeWithDevTools } from 'redux-devtools-extension/logOnlyInProduction';

export default (preloadedState, preloadedReducers) => createStore(
  preloadedReducers ? combineReducers(preloadedReducers) : () => ({}),
  preloadedState,
  composeWithDevTools(
    applyMiddleware(thunk),
    enhancer(preloadedReducers),
  ),
);

Update Redux DevTools to log only in production env
Update Redux DevTools to log only in production env
