Types src/content

This commit is contained in:
Shin'ya Ueoka 2019-05-02 14:08:51 +09:00
parent 992b3ac65d
commit d01db82c0d
62 changed files with 1411 additions and 468 deletions

View file

@ -1,11 +1,18 @@
import actions from 'content/actions';
import * as actions from '../actions';
export interface State {
keymaps: any[];
}
const defaultState = {
// keymaps is and arrays of key-binding pairs, which is entries of Map
keymaps: [],
};
export default function reducer(state = defaultState, action = {}) {
export default function reducer(
state: State = defaultState,
action: actions.SettingAction,
): State {
switch (action.type) {
case actions.SETTING_SET:
return { ...action.value };