diff options
Diffstat (limited to 'src/reducers/input.js')
-rw-r--r-- | src/reducers/input.js | 11 |
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; |