A fork of https://github.com/ueokande/vim-vixen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
385 B
19 lines
385 B
7 years ago
|
import actions from 'content/actions';
|
||
7 years ago
|
|
||
|
const defaultState = {
|
||
7 years ago
|
keys: []
|
||
7 years ago
|
};
|
||
|
|
||
|
export default function reducer(state = defaultState, action = {}) {
|
||
|
switch (action.type) {
|
||
|
case actions.INPUT_KEY_PRESS:
|
||
6 years ago
|
return { ...state,
|
||
|
keys: state.keys.concat([action.key]), };
|
||
7 years ago
|
case actions.INPUT_CLEAR_KEYS:
|
||
6 years ago
|
return { ...state,
|
||
|
keys: [], };
|
||
7 years ago
|
default:
|
||
|
return state;
|
||
|
}
|
||
|
}
|