Skip to content
Snippets Groups Projects
Select Git revision
  • 3729cd91d24a842db91ec41a61eea3c9f8648cf7
  • 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

CorrectSolutionReducer.js

Blame
  • CorrectSolutionReducer.js 390 B
    import { WRITE_SOLUTION, CHECK } from '../actions/types';
    
    const INITIAL_STATE = {
      accepted: false,
      note: '',
    };
    
    export default (state = INITIAL_STATE, action) => {
      switch (action.type) {
        case WRITE_SOLUTION:
          return { ...state, [action.target]: action.payload };
        case CHECK:
          return { ...state, accepted: !state.accepted };
        default:
          return state;
      }
    };