aboutsummaryrefslogtreecommitdiff
path: root/src/reducers
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-03 20:58:50 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-10-03 20:58:50 +0900
commit5ac1f60ece0a112a55f329ed34b455dcc776b22c (patch)
tree1c901a6529fd50b9e62d50a2131c3043ccfb5079 /src/reducers
parenteff8d9a83edf63bab09df4bd7f6e20e85fba3899 (diff)
remove deprecated property in KeyboardEvent
Diffstat (limited to 'src/reducers')
-rw-r--r--src/reducers/input.js11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/reducers/input.js b/src/reducers/input.js
index eb7ff24..8be701e 100644
--- a/src/reducers/input.js
+++ b/src/reducers/input.js
@@ -1,23 +1,18 @@
import actions from '../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.concat([
- {
- code: action.code,
- ctrl: action.ctrl
- }
- ])
+ keys: state.keys + action.key
});
case actions.INPUT_CLEAR_KEYS:
return Object.assign({}, state, {
- keys: [],
+ keys: '',
});
default:
return state;