Skip to content
Snippets Groups Projects
Select Git revision
  • 2e24d7f820b3e32e98fbac7b9ae68f812058fbe5
  • master default protected
  • 1.3.1
  • 1.3.0
  • 1.2.0
  • 1.1.5
  • 1.1.4
  • 1.1.3
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.19
  • 1.0.18
  • 1.0.17
  • 1.0.16
  • 1.0.15
  • 1.0.14
  • 1.0.13
  • 1.0.12
  • 1.0.10
  • 1.0.9
  • 1.0.8
22 results

AddTaskReducer.js

Blame
  • Forked from KSZK / DevTeam / kszkepzes / old / kszkepzes-frontend
    Source project has a limited visibility.
    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;
      }
    };