This repository has been archived on 2020-04-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Vim-Vixen/src/content/reducers/addon.ts
2019-05-05 23:59:59 +09:00

22 lines
396 B
TypeScript

import * as actions from '../actions';
export interface State {
enabled: boolean;
}
const defaultState: State = {
enabled: true,
};
export default function reducer(
state: State = defaultState,
action: actions.AddonAction,
): State {
switch (action.type) {
case actions.ADDON_SET_ENABLED:
return { ...state,
enabled: action.enabled, };
default:
return state;
}
}