Select Git revision
AddNewsReducer.js
Forked from
KSZK / DevTeam / kszkepzes / old / kszkepzes-frontend
186 commits behind the upstream repository.
-
Chif Gergő authoredChif Gergő authored
AddNewsReducer.js 357 B
import { WRITE_NEWS, CLEAR_WRITE } from '../actions/types';
const INITIAL_STATE = { title: '', text: '' };
export default (state = INITIAL_STATE, action) => {
switch (action.type) {
case WRITE_NEWS:
return { ...state, [action.target]: action.payload };
case CLEAR_WRITE:
return INITIAL_STATE;
default:
return state;
}
};