Skip to content
Snippets Groups Projects
Select Git revision
  • b1a78bdc6a0aa4af2436fde56bc9df31108e1071
  • master default protected
  • reinstall-2023
3 results

override.conf

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;
      }
    };