Forked from
KSZK / DevTeam / kszkepzes / old / kszkepzes-frontend
311 commits behind the upstream repository.
-
Bereczki Sandor authored
Listing the tasks based by its properties and states, also counting with empty lists.
Bereczki Sandor authoredListing the tasks based by its properties and states, also counting with empty lists.
HomeworksReducer.js 394 B
import { GET_HOMEWORKS, GET_SOLUTIONS } from '../actions/types';
const INITIAL_STATE = {
tasks: [],
solutions: [],
};
export default (state = INITIAL_STATE, action) => {
switch (action.type) {
case GET_HOMEWORKS:
return { ...state, tasks: action.payload };
case GET_SOLUTIONS:
return { ...state, solutions: action.payload };
default:
return state;
}
};