support mutliple modifiers for key bindings

This commit is contained in:
Shin'ya Ueoka 2017-11-05 09:47:30 +09:00
parent 4e94695c75
commit 036ede3379
11 changed files with 75 additions and 75 deletions

View file

@ -1,18 +1,18 @@
import actions from 'content/actions';
const defaultState = {
keys: ''
keys: []
};
export default function reducer(state = defaultState, action = {}) {
switch (action.type) {
case actions.INPUT_KEY_PRESS:
return Object.assign({}, state, {
keys: state.keys + action.key
keys: state.keys.concat([action.key]),
});
case actions.INPUT_CLEAR_KEYS:
return Object.assign({}, state, {
keys: '',
keys: [],
});
default:
return state;