5b5f1edb22
- Moved applyDefaults + related code - Added tests for /actions/config.js - Fixed some ESLint errors
18 lines
490 B
JavaScript
18 lines
490 B
JavaScript
import Immutable from 'immutable';
|
|
import { CONFIG_REQUEST, CONFIG_SUCCESS, CONFIG_FAILURE } from '../actions/config';
|
|
|
|
const config = (state = null, action) => {
|
|
switch (action.type) {
|
|
case CONFIG_REQUEST:
|
|
return Immutable.Map({ isFetching: true });
|
|
case CONFIG_SUCCESS:
|
|
return Immutable.fromJS(action.payload);
|
|
case CONFIG_FAILURE:
|
|
return Immutable.Map({ error: action.payload.toString() });
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default config;
|