State
Code
First State (before calling API)
The first state has only one property loading
before calling API.
Name | Type | Default | Description |
loading | boolean | false | To indicate whether calling api or not. |
fromCache | boolean | false | To tell whether the data come from SSR API cache. |
Full State
The is the full state data structure after the api has responded.
Name | Type | Default | Description |
loading | boolean | false | To indicate whether calling api or not. |
fromCache | boolean | false | To tell whether the data come from SSR API cache. |
data | any | undefined | The processed data provided from |
response | AxiosResponse | undefined | The Axios' response. |
error | AxiosError | undefined | The Axios' error. |
dependencies | Object | undefined | The additional needed data using in handleData. |
prevData | any | undefined | The previous data of the previous state. |
prevState | ReactUseApi.State | undefined | The previous state. |
[custom data] | any | You can add your own custom state data into the state by setting up in |
Last updated