From b69cc04856fd21d325193d56e212e4dbf07cb762 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Wed, 11 Jul 2018 21:01:22 +0900 Subject: Use combineReducers --- src/background/reducers/index.js | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'src/background/reducers') diff --git a/src/background/reducers/index.js b/src/background/reducers/index.js index 78f855c..465f927 100644 --- a/src/background/reducers/index.js +++ b/src/background/reducers/index.js @@ -1,17 +1,8 @@ -import settingReducer from './setting'; -import findReducer from './find'; -import tabReducer from './tab'; +import { combineReducers } from 'redux'; +import setting from './setting'; +import find from './find'; +import tab 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 { ...state, - setting: settingReducer(state.setting, action), - find: findReducer(state.find, action), - tab: tabReducer(state.tab, action), }; -} +export default combineReducers({ + setting, find, tab, +}); -- cgit v1.2.3