You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| instance | object |`axios`| Axios instance. You can pass your axios with a custom config. |
60
+
| getResponseItem | function |`(r) => r.data`| custom `data` value. The default value is response['data']. [PR#1](https://github.com/axios-use/axios-use-vue/pull/1)|
The `request` function allows you to define the response type coming from it. It also helps with creating a good pattern on defining your API calls and the expected results. It's just an identity function that accepts the request config and returns it. Both `useRequest` and `useResource` extract the expected and annotated type definition and resolve it on the `response.data` field.
// You can use `getResponseItem` to customize the value of `data`
310
+
unref(reqState).data;
311
+
```
312
+
288
313
#### createRequestError
289
314
290
315
The `createRequestError` normalizes the error response. This function is used internally as well. The `isCancel` flag is returned, so you don't have to call **axios.isCancel** later on the promise catch block.
* A callback function that's called when the request encounters one or more errors.
66
77
* This function is passed an `RequestError` object that contains either a networkError object or a `AxiosError`, depending on the error(s) that occurred.
0 commit comments