sisense.com
✅ You are viewing documentation for the latest version of Compose SDK.
Version:

Function useFetch

useFetch<TData, TError>(...args): UseQueryResult< TData, TError >

React hook that allows to make authorized fetch request to any Sisense API.

Type parameters

ParameterDefault
TDataunknown
TErrorunknown

Parameters

ParameterType
...args[string, RequestInit, {
enabled: boolean;
requestConfig: RequestConfig;
}]

Returns

UseQueryResult< TData, TError >

Query state that contains the status of the query execution, the result data, or the error if any occurred

Example

 const { data, isLoading, error } = useFetch<unknown, Error>('api/v1/elasticubes/getElasticubes', {
   method: 'POST',
 });
Last Updated: