18 lines
417 B
JavaScript
18 lines
417 B
JavaScript
import { EVENTS_LOADED, GET_EVENTS } from '../constants/actionTypes.js';
|
|
|
|
export const events = (state = {}, action) => {
|
|
switch (action.type) {
|
|
case GET_EVENTS:
|
|
return Object.assign({}, state, {
|
|
isFetching: true,
|
|
});
|
|
case EVENTS_LOADED:
|
|
return Object.assign({}, state, {
|
|
events: action.payload,
|
|
isFetching: false,
|
|
});
|
|
default:
|
|
return state;
|
|
}
|
|
};
|