mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
handle error and loading state
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
import { apiClient } from "../../apiclient";
|
||||
import * as types from "../../modules/types";
|
||||
import type { Action } from "../../types/Action";
|
||||
import { isPending } from "../../modules/pending";
|
||||
import { getFailure } from "../../modules/failure";
|
||||
|
||||
export const FETCH_CONFIG = "scm/groups/FETCH_CONFIG";
|
||||
export const FETCH_CONFIG_PENDING = `${FETCH_CONFIG}_${types.PENDING_SUFFIX}`;
|
||||
@@ -69,3 +71,13 @@ function reducer(state: any = {}, action: any = {}) {
|
||||
}
|
||||
|
||||
export default reducer;
|
||||
|
||||
// selectors
|
||||
|
||||
export function isFetchConfigPending(state: Object) {
|
||||
return isPending(state, FETCH_CONFIG);
|
||||
}
|
||||
|
||||
export function getFetchConfigFailure(state: Object) {
|
||||
return getFailure(state, FETCH_CONFIG);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user