export default (state, action) => {
    switch (action.type) {
        case "LOGIN_REQUEST":
            return {
                ...state, isLoading: true
            };
        case "LOGIN_SUCCESS":
            return {
                ...state, loginState: action.response.login
            };
        case "LOGIN_FAILURE":
            return {
                ...state, loginState: false, error: action.error
            };
        default: return {
            ...state
        };
    }
};