static-cms/src/reducers/config.js

16 lines
425 B
JavaScript
Raw Normal View History

2016-02-25 00:45:56 -08:00
import Immutable from 'immutable';
import { CONFIG } from '../actions/config';
export function 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;
}
}