1 | import { combineReducers } from 'redux';
|
2 | import { routerReducer as routing } from 'react-router-redux';
|
3 | import user from '../reducers/user';
|
4 | import topic from '../reducers/topic';
|
5 | import message from '../reducers/message';
|
6 | import * as types from '../types';
|
7 |
|
8 | const isFetching = (state = false, action) => {
|
9 | switch (action.type) {
|
10 | case types.CREATE_REQUEST:
|
11 | return true;
|
12 | case types.REQUEST_SUCCESS:
|
13 | case types.REQUEST_FAILURE:
|
14 | return false;
|
15 | default:
|
16 | return state;
|
17 | }
|
18 | };
|
19 |
|
20 |
|
21 |
|
22 | const rootReducer = combineReducers({
|
23 | isFetching,
|
24 | topic,
|
25 | user,
|
26 | message,
|
27 | routing
|
28 | });
|
29 |
|
30 | export default rootReducer;
|