support mutliple modifiers for key bindings
This commit is contained in:
parent
4e94695c75
commit
036ede3379
11 changed files with 75 additions and 75 deletions
|
@ -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;
|
||||
|
|
Reference in a new issue