22 lines
465 B
JavaScript
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;
|
|
}
|
|
}
|
|
|