aboutsummaryrefslogtreecommitdiff
path: root/src/background/reducers/index.js
blob: 5729f0a5e7080c15a38886ebc2d09d26ee5949a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import settingReducer from './setting';
import findReducer from './find';
import tabReducer from './tab';

// Make setting reducer instead of re-use
const defaultState = {
  setting: settingReducer(undefined, {}),
  find: findReducer(undefined, {}),
  tab: tabReducer(undefined, {}),
};

export default function reducer(state = defaultState, action = {}) {
  return Object.assign({}, state, {
    setting: settingReducer(state.setting, action),
    find: findReducer(state.find, action),
    tab: tabReducer(state.tab, action),
  });
}