setting as redux
This commit is contained in:
parent
709fa95aa3
commit
61806a4e7f
6 changed files with 112 additions and 19 deletions
17
src/reducers/setting.js
Normal file
17
src/reducers/setting.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
import actions from '../actions';
|
||||
|
||||
const defaultState = {
|
||||
settings: {}
|
||||
};
|
||||
|
||||
export default function reducer(state = defaultState, action = {}) {
|
||||
switch (action.type) {
|
||||
case actions.SETTING_SET_SETTINGS:
|
||||
return Object.assign({}, state, {
|
||||
settings: action.settings,
|
||||
});
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
Reference in a new issue