{"size": 644, "ext": "js", "max_stars_repo_path": "src/reducers/errorReducer.js", "max_stars_repo_name": "SincerelyBrittany/music-diary-client", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/reducers/errorReducer.js", "max_issues_repo_name": "SincerelyBrittany/music-diary-client", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/reducers/errorReducer.js", "max_forks_repo_name": "SincerelyBrittany/music-diary-client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.7741935484, "max_line_length": 70, "alphanum_fraction": 0.4378881988}
// const initState = {
//     error: null
//    };
   
//    export function errorReducer(state = initState, action){
//     const { error } = action;
   
//     if(error){
//     return {
//     error: error
//     }
//     }
   
//     return state;
//    }

export default function errorReducer(state = {message: "" }, action) {
    switch (action.type) {
        case "ADD_ERROR":
            return {
                ...state,
                message: action.message
            }
     case "REMOVE_ERROR":
                return {
                  state: {message: "" }
                }
        default:
            return state
    }
}