scinote-web/app/javascript/packs/shared/reducers/ActivitiesReducers.js
2017-08-03 11:17:09 +02:00

21 lines
446 B
JavaScript

import {
GLOBAL_ACTIVITIES_DATA,
MORE_GLOBAL_ACTIVITIES
} from "../actions/types";
export function globalActivities(
state = { more: true, activities: [] },
action
) {
if (action.type === GLOBAL_ACTIVITIES_DATA) {
return {
...state,
activities: [
...state.activities,
...action.payload.global_activities.activities
],
more: action.payload.global_activities.more
};
}
return state;
}