diff options
Diffstat (limited to 'src/background')
-rw-r--r-- | src/background/components/operation.js | 2 | ||||
-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 |
4 files changed, 7 insertions, 11 deletions
diff --git a/src/background/components/operation.js b/src/background/components/operation.js index 58edb8c..465baf0 100644 --- a/src/background/components/operation.js +++ b/src/background/components/operation.js @@ -28,7 +28,7 @@ export default class BackgroundComponent { } } - // eslint-disable-next-line complexity + // eslint-disable-next-line complexity, max-lines-per-function exec(operation, tab) { let tabState = this.store.getState().tab; 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; |