2016-06-16 15:04:14 +12:00
|
|
|
import deepFreeze from 'deep-freeze-strict';
|
2016-04-21 21:59:44 +12:00
|
|
|
import ACTION_TYPES from './ConfigActionTypes';
|
2016-03-22 16:27:44 +13:00
|
|
|
|
|
|
|
function configReducer(state = {}, action) {
|
2016-03-31 10:45:54 +13:00
|
|
|
switch (action.type) {
|
2016-03-22 16:27:44 +13:00
|
|
|
|
2016-03-31 10:45:54 +13:00
|
|
|
case ACTION_TYPES.SET_CONFIG:
|
|
|
|
return deepFreeze(Object.assign({}, state, action.payload.config));
|
2016-03-22 16:27:44 +13:00
|
|
|
|
2016-03-31 10:45:54 +13:00
|
|
|
default:
|
|
|
|
return state;
|
2016-03-22 16:27:44 +13:00
|
|
|
|
2016-03-31 10:45:54 +13:00
|
|
|
}
|
2016-03-22 16:27:44 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
export default configReducer;
|