2018-11-18 11:00:15 +05:30
|
|
|
import { LOADING, ERROR, SUCCESS, STATUS_FAILED } from '../constants';
|
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
export const summaryStatus = (state) => {
|
2018-11-18 11:00:15 +05:30
|
|
|
if (state.isLoading) {
|
|
|
|
return LOADING;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (state.hasError || state.status === STATUS_FAILED) {
|
|
|
|
return ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return SUCCESS;
|
|
|
|
};
|