// import { connectRouter } from 'connected-react-router';
import { connectRouter } from 'connected-react-router/immutable';
// import { combineReducers } from 'redux';
import { combineReducers } from 'redux-immutable';

// import history from './utils/history';
import { history } from '@wisdom-utils/runtime';

import { reducer as globalReducer } from './containers/App/store';

export default function createReducer(injectedReducers = {}) {
  const rootReducer = combineReducers({
    global: globalReducer,
    router: connectRouter(history),
    ...injectedReducers,
  });

  return rootReducer;
}
