aboutsummaryrefslogtreecommitdiff
path: root/src/content/reducers/index.js
blob: c3a474e133f54d1d94f667a8d0ada744effe3b80 (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
24
25
import addonReducer from './addon';
import findReducer from './find';
import settingReducer from './setting';
import inputReducer from './input';
import followControllerReducer from './follow-controller';

// Make setting reducer instead of re-use
const defaultState = {
  addon: addonReducer(undefined, {}),
  find: findReducer(undefined, {}),
  setting: settingReducer(undefined, {}),
  input: inputReducer(undefined, {}),
  followController: followControllerReducer(undefined, {}),
};

export default function reducer(state = defaultState, action = {}) {
  return {
    ...state,
    addon: addonReducer(state.addon, action),
    find: findReducer(state.find, action),
    setting: settingReducer(state.setting, action),
    input: inputReducer(state.input, action),
    followController: followControllerReducer(state.followController, action),
  };
}