Skip to content
Snippets Groups Projects
Select Git revision
  • d83f458128579f31df2b9ac2ebbaee349558603a
  • master default protected
2 results

app.py

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