Select Git revision
AddTaskReducer.js
Forked from
KSZK / DevTeam / kszkepzes / old / kszkepzes-frontend
Source project has a limited visibility.
-
Bereczki Sandor authored
You can now create new tasks and upload a solution (or more) for them.
Bereczki Sandor authoredYou can now create new tasks and upload a solution (or more) for them.
AddTaskReducer.js 482 B
import { WRITE_TASK, WRITE_TASK_DEADLINE, CLEAR_WRITE } from '../actions/types';
const INITIAL_STATE = { title: '', text: '', deadline: '' };
export default (state = INITIAL_STATE, action) => {
switch (action.type) {
case WRITE_TASK:
return { ...state, [action.target]: action.payload };
case WRITE_TASK_DEADLINE:
return { ...state, [action.target]: action.payload };
case CLEAR_WRITE:
return INITIAL_STATE;
default:
return state;
}
};