{"size": 918, "ext": "js", "max_stars_repo_path": "client/src/app/reducers/alert.js", "max_stars_repo_name": "andresfelipe9619/fruver-project", "max_stars_repo_stars_event_min_datetime": "2018-04-23T03:15:43.000Z", "max_stars_repo_stars_event_max_datetime": "2018-04-29T22:02:17.000Z", "max_issues_repo_path": "src/app/reducers/alert.js", "max_issues_repo_name": "cuervosdk/sig-cantera", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/app/reducers/alert.js", "max_forks_repo_name": "cuervosdk/sig-cantera", "max_forks_repo_forks_event_min_datetime": "2018-05-04T02:53:08.000Z", "max_forks_repo_forks_event_max_datetime": "2018-05-04T02:53:08.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 24.1578947368, "max_line_length": 89, "alphanum_fraction": 0.6111111111}
import {SUCCESS_ALERT, ERROR_ALERT, CLEAR_ALERT} from '../actions/constants/ActionTypes';


export function alertSuccess(state = '', action) {
    switch (action.type) {
        case SUCCESS_ALERT:
            return action.message;
        default:
            return state;
    }
}

export function alertError(state = '', action) {
    switch (action.type) {
        case ERROR_ALERT:
            return action.message;
        default:
            return state;
    }
}

export function alertClear(state = '', action) {
    switch (action.type) {
        case CLEAR_ALERT:
            return action.bool;
        default:
            return state;
    }
}


export default function alertReducer(state = {}, action){
    return {
        alertError: alertError(state.alertError, action),
        alertSuccess: alertSuccess(state.alertSuccess, action),
        alertClear: alertClear(state.alertClear, action)
    }
}