blob: 045a654fcb45fdfbeea64ba41060a03581af928c (
plain) (
blame)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 | 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: Object.assign({}, state.value, {
        properties: Object.assign({}, state.value.properties,
          { [action.name]: action.value })
      })
    };
  default:
    return state;
  }
}
 |