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/background/reducers/setting.js
2018-06-28 20:44:57 +09:00

22 lines
465 B
JavaScript

import actions from 'background/actions';
const defaultState = {
value: {},
};
export default function reducer(state = defaultState, action = {}) {
switch (action.type) {
case actions.SETTING_SET_SETTINGS:
return {
value: action.value,
};
case actions.SETTING_SET_PROPERTY:
return {
value: { ...state.value,
properties: { ...state.value.properties, [action.name]: action.value }}
};
default:
return state;
}
}