mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-18 15:13:21 +08:00
27 lines
643 B
JavaScript
27 lines
643 B
JavaScript
import {
|
|
GLOBAL_ACTIVITIES_DATA,
|
|
DESTROY_GLOBAL_ACTIVITIES_DATA
|
|
} from "../../app/action_types";
|
|
|
|
const initialStateu = { more: true, activities: [] };
|
|
|
|
export function globalActivities(state = initialStateu, action) {
|
|
switch (action.type) {
|
|
case GLOBAL_ACTIVITIES_DATA:
|
|
return {
|
|
...state,
|
|
activities: [
|
|
...state.activities,
|
|
...action.payload.global_activities.activities
|
|
],
|
|
more: action.payload.global_activities.more
|
|
};
|
|
case DESTROY_GLOBAL_ACTIVITIES_DATA:
|
|
return {
|
|
...state,
|
|
...initialStateu
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
}
|