debian-mirror-gitlab/app/assets/javascripts/reports/store/getters.js
2020-10-24 23:57:45 +05:30

14 lines
321 B
JavaScript

import { LOADING, ERROR, SUCCESS, STATUS_FAILED } from '../constants';
// eslint-disable-next-line import/prefer-default-export
export const summaryStatus = state => {
if (state.isLoading) {
return LOADING;
}
if (state.hasError || state.status === STATUS_FAILED) {
return ERROR;
}
return SUCCESS;
};