Skip to content
0

katanakit-js / useFetchApi

Function: useFetchApi() ​

ts
function useFetchApi<T>(
   apiName, 
   endpointName, 
   options?
): Promise<FetchResult<T>>;

Defined in: src/core/services/http.service.ts:721

Fetches a registered endpoint and returns a Safe Result. Alias for useFetch.

Type Parameters ​

Type ParameterDefault type
Tunknown

Parameters ​

ParameterTypeDescription
apiNamestringThe registered API key.
endpointNamestringThe endpoint key within the API.
options?FetchOptions<T>Optional fetch options.

Returns ​

Promise<FetchResult<T>>

A FetchResult with data or error.

Released under the MIT License.