UNPKG

@dabapps/redux-requests

Version:
11 lines (10 loc) 1.07 kB
import { AxiosError, AxiosPromise, AxiosRequestConfig } from 'axios'; import { AsyncActionSet, Dict, ResponsesReducerState } from './types'; export declare function makeAsyncActionSet(actionName: string): AsyncActionSet; export declare function formatQueryParams(params?: Dict<string | number | boolean | null | undefined>): string; export declare function apiRequest<T = {}>(options: AxiosRequestConfig): AxiosPromise<T>; export declare function isPending<T>(state: ResponsesReducerState<T>, actionSet: AsyncActionSet, tag?: string): boolean; export declare function hasFailed<T>(state: ResponsesReducerState<T>, actionSet: AsyncActionSet, tag?: string): boolean; export declare function hasSucceeded<T>(state: ResponsesReducerState<T>, actionSet: AsyncActionSet, tag?: string): boolean; export declare function anyPending<T>(state: ResponsesReducerState<T>, actionSets: ReadonlyArray<AsyncActionSet | [AsyncActionSet, string]>): boolean; export declare function getErrorData<T>(state: ResponsesReducerState<T>, actionSet: AsyncActionSet, tag?: string): AxiosError | null;