diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-03-07 21:34:37 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-07 21:34:37 +0900 |
commit | d2a3c6cdd4d6ca564d9a80d281ba14648ffcc6eb (patch) | |
tree | 0de3603c8cffef056584413ef8a5a0dc051b8d8f /src/background/reducers | |
parent | 72bf3cc2bdcc63864e064a64f7459aba004f4538 (diff) | |
parent | 92f8365be7127c3fa0276b1a6e890571f634622e (diff) |
Merge pull request #355 from ueokande/search-across-pages
Search across pages
Diffstat (limited to 'src/background/reducers')
-rw-r--r-- | src/background/reducers/find.js | 16 | ||||
-rw-r--r-- | src/background/reducers/index.js | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/background/reducers/find.js b/src/background/reducers/find.js new file mode 100644 index 0000000..4ded801 --- /dev/null +++ b/src/background/reducers/find.js @@ -0,0 +1,16 @@ +import actions from 'content/actions'; + +const defaultState = { + keyword: null, +}; + +export default function reducer(state = defaultState, action = {}) { + switch (action.type) { + case actions.FIND_SET_KEYWORD: + return Object.assign({}, state, { + keyword: action.keyword, + }); + default: + return state; + } +} diff --git a/src/background/reducers/index.js b/src/background/reducers/index.js index dab0c62..63ff0f8 100644 --- a/src/background/reducers/index.js +++ b/src/background/reducers/index.js @@ -1,12 +1,15 @@ import settingReducer from './setting'; +import findReducer from './find'; // Make setting reducer instead of re-use const defaultState = { setting: settingReducer(undefined, {}), + find: findReducer(undefined, {}), }; export default function reducer(state = defaultState, action = {}) { return Object.assign({}, state, { setting: settingReducer(state.setting, action), + find: findReducer(state.find, action), }); } |