aboutsummaryrefslogtreecommitdiff
path: root/src/reducers/index.js
blob: db17edff316ddb98a21f8dfe9d8f880cf15c48e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import inputReducer from '../reducers/input';
import consoleReducer from '../reducers/console';
import settingReducer from '../reducers/setting';
import followReducer from '../reducers/follow';
import completionReducer from '../reducers/completion';

const defaultState = {
  input: inputReducer(undefined, {}),
  console: consoleReducer(undefined, {}),
  setting: settingReducer(undefined, {}),
  follow: followReducer(undefined, {}),
  completion: completionReducer(undefined, {}),
};

export default function reducer(state = defaultState, action = {}) {
  return Object.assign({}, state, {
    input: inputReducer(state.input, action),
    console: consoleReducer(state.console, action),
    setting: settingReducer(state.setting, action),
    follow: followReducer(state.follow, action),
    completion: completionReducer(state.completion, action),
  });
}