add set property action in background
This commit is contained in:
parent
6083e70ea0
commit
22c34a0a6f
4 changed files with 36 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
import actions from 'settings/actions';
|
||||
import actions from 'background/actions';
|
||||
|
||||
const defaultState = {
|
||||
value: {},
|
||||
|
@ -10,6 +10,13 @@ export default function reducer(state = defaultState, action = {}) {
|
|||
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;
|
||||
}
|
||||
|
|
Reference in a new issue