diff options
Diffstat (limited to 'src/background/reducers')
-rw-r--r-- | src/background/reducers/find.js | 5 | ||||
-rw-r--r-- | src/background/reducers/index.js | 5 | ||||
-rw-r--r-- | src/background/reducers/setting.js | 6 |
3 files changed, 6 insertions, 10 deletions
diff --git a/src/background/reducers/find.js b/src/background/reducers/find.js index 4ded801..bbc6b36 100644 --- a/src/background/reducers/find.js +++ b/src/background/reducers/find.js @@ -7,9 +7,8 @@ const defaultState = { export default function reducer(state = defaultState, action = {}) { switch (action.type) { case actions.FIND_SET_KEYWORD: - return Object.assign({}, state, { - keyword: action.keyword, - }); + return { ...state, + keyword: action.keyword, }; default: return state; } diff --git a/src/background/reducers/index.js b/src/background/reducers/index.js index 5729f0a..78f855c 100644 --- a/src/background/reducers/index.js +++ b/src/background/reducers/index.js @@ -10,9 +10,8 @@ const defaultState = { }; export default function reducer(state = defaultState, action = {}) { - return Object.assign({}, state, { + return { ...state, setting: settingReducer(state.setting, action), find: findReducer(state.find, action), - tab: tabReducer(state.tab, action), - }); + tab: tabReducer(state.tab, action), }; } diff --git a/src/background/reducers/setting.js b/src/background/reducers/setting.js index 045a654..8dbc1b4 100644 --- a/src/background/reducers/setting.js +++ b/src/background/reducers/setting.js @@ -12,10 +12,8 @@ export default function reducer(state = defaultState, action = {}) { }; case actions.SETTING_SET_PROPERTY: return { - value: Object.assign({}, state.value, { - properties: Object.assign({}, state.value.properties, - { [action.name]: action.value }) - }) + value: { ...state.value, + properties: { ...state.value.properties, [action.name]: action.value }} }; default: return state; |