import { fromJS } from 'immutable' ; import { combineReducers } from 'redux-immutable' ; import { LOCATION_CHANGE } from 'react-router-redux' ; import { Action , Reducer } from 'redux' ; const routeInitialState = fromJS ( { location : null } ) ; function routeReducer ( state = routeInitialState , action ) { switch ( action . type ) { case LOCATION_CHANGE : return state . merge ( { location : action . payload } ) ; default : return state ; } } export default function createReducer ( asyncReducers ? ) { return combineReducers ( { route : routeReducer , ... asyncReducers } ) ; }