aboutsummaryrefslogtreecommitdiff
path: root/src/reducers/input.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-03 21:31:25 +0900
committerGitHub <noreply@github.com>2017-10-03 21:31:25 +0900
commit3244c3c35db7639dc1bb08d9b0bcd40323e9d626 (patch)
tree1acf04feeb4b246240e573744306d227620c7294 /src/reducers/input.js
parentb5e52a75d760c23d2ac7257056f9ba592ad17b34 (diff)
parent4b5616b5244f14a8e6b1edf59e944edb7d8ae2d4 (diff)
Merge pull request #16 from ueokande/enable-keys
Enable keys on github.com
Diffstat (limited to 'src/reducers/input.js')
-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;