- useApi<ApiResponse>(apiFunction): {
data: ApiResponse;
error: string;
isLoading: boolean;
onApi: (() => Promise<ApiResponse>);
} Parameters
apiFunction: (() => Promise<ApiResponse>)
- (): Promise<ApiResponse>
Returns Promise<ApiResponse>
Returns {
data: ApiResponse;
error: string;
isLoading: boolean;
onApi: (() => Promise<ApiResponse>);
}
data: ApiResponse
error: string
isLoading: boolean
onApi: (() => Promise<ApiResponse>)
- (): Promise<ApiResponse>
Returns Promise<ApiResponse>