- Cleanup

This commit is contained in:
2019-08-06 01:36:08 -04:00
parent 6e71ac688a
commit b8ddc54b99
43 changed files with 361 additions and 170 deletions

View File

@@ -5,12 +5,11 @@ import { EVENTS_LOADED, GET_EVENTS } from '../constants/actionTypes.js';
export const events = (state = new Map(), action) => {
switch (action.type) {
case EVENTS_LOADED:
return state.merge(
action.payload.toMap().mapEntries((entry) => {
const mapped = action.payload.toMap().mapEntries((entry) => {
const [, event] = entry;
return [`${event.id}`, event];
}),
);
});
return state.merge(mapped);
case GET_EVENTS:
default:
return state;