2020-04-01 19:24:42 +00:00
|
|
|
import { SETTINGS } from '../actions/actionsTypes';
|
|
|
|
|
|
|
|
const initialState = {};
|
|
|
|
|
|
|
|
export default (state = initialState, action) => {
|
|
|
|
switch (action.type) {
|
|
|
|
case SETTINGS.ADD:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
...action.payload
|
|
|
|
};
|
2021-07-01 19:30:55 +00:00
|
|
|
case SETTINGS.UPDATE:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
[action.payload.id]: action.payload.value
|
|
|
|
};
|
2020-04-01 19:24:42 +00:00
|
|
|
case SETTINGS.CLEAR:
|
|
|
|
return initialState;
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|