static-cms/src/reducers/collections.js
Mathias Biilmann Christensen a39307bd8b Add missing semicolon
2016-06-18 12:29:03 -07:00

19 lines
528 B
JavaScript

import { OrderedMap, fromJS } from 'immutable';
import { CONFIG_SUCCESS } from '../actions/config';
const collections = (state = null, action) => {
switch (action.type) {
case CONFIG_SUCCESS:
const collections = action.payload && action.payload.collections;
return OrderedMap().withMutations((map) => {
(collections || []).forEach(function(collection) {
map.set(collection.name, fromJS(collection));
});
});
default:
return state;
}
};
export default collections;