import { combineReducers } from 'redux';

function data(state = [], action) {
    switch(action.type) {
        case "PROPERTY_SALE_AVERAGE_SURFACE_PRICE_SUCCESS":
            return action.retrieved;
        default:
            return state;
    }
}

function error(state = null, action) {
    switch(action.type) {
        case "PROPERTY_SALE_AVERAGE_SURFACE_PRICE_ERROR":
            return action.error;
        default:
            return state;
    }
}

function loading(state = false, action) {
    switch(action.type) {
        case "PROPERTY_SALE_AVERAGE_SURFACE_PRICE_LOADING":
            return action.loading;
        default:
            return state;
    }
}

export default combineReducers({
    data,
    error,
    loading,
});