load keymaps from storage

This commit is contained in:
Shin'ya Ueoka 2017-09-27 21:51:39 +09:00
parent 8ba490ea11
commit e97ffafea3
7 changed files with 85 additions and 51 deletions

View file

@ -2,6 +2,7 @@ import actions from '../actions';
const defaultState = {
keys: [],
keymaps: {}
};
export default function reducer(state = defaultState, action = {}) {
@ -19,6 +20,11 @@ export default function reducer(state = defaultState, action = {}) {
return Object.assign({}, state, {
keys: [],
});
case actions.INPUT_SET_KEYMAPS:
return Object.assign({}, state, {
keymaps: action.keymaps,
keys: [],
});
default:
return state;
}