nelreina
12/5/2016 - 5:48 PM

rootReducer.js

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

const logger = store => next => action => {
  console.group(action.type);
  console.info('dispaching', action);
  const result = next(action);
  console.log('next state', store.getState());
  console.groupEnd(action.type);
  return result;
};

export default (initialState = {}) => {
  let enhancer;
  const middelwares = applyMiddleware(thunk, logger);

  enhancer = composeWithDevTools(middelwares);

  return createStore(rootReducer, initialState, enhancer);
};
import { combineReducers } from 'redux';

export default combineReducers({
  default: (state ={}, action) => state
})