axios-hooks
Advanced tools
Comparing version
@@ -5,2 +5,6 @@ # Changelog | ||
### [1.2.1](https://github.com/simoneb/axios-hooks/compare/v1.2.0...v1.2.1) (2019-07-21) | ||
## [1.2.0](https://github.com/simoneb/axios-hooks/compare/v1.1.5...v1.2.0) (2019-07-18) | ||
@@ -7,0 +11,0 @@ |
import { AxiosRequestConfig, AxiosError, AxiosPromise } from 'axios' | ||
interface ResponseValues { | ||
data: any | ||
interface ResponseValues<T> { | ||
data: T | ||
loading: boolean | ||
@@ -17,8 +17,8 @@ error?: AxiosError | ||
export default function useAxios( | ||
export default function useAxios<T = any>( | ||
config: AxiosRequestConfig | string, | ||
options?: Options | ||
): [ | ||
ResponseValues, | ||
ResponseValues<T>, | ||
(config?: AxiosRequestConfig, options?: RefetchOptions) => void | ||
] |
{ | ||
"name": "axios-hooks", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "axios-hooks", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -84,3 +84,3 @@ # axios-hooks | ||
- `execute([config])` Function to execute the request manually, bypassing the cache. It optionally accepts the same `config` object as `axios`, which is _shallow-merged_ with the config object provided when invoking the hook. Useful to provide arguments to non-GET requests. | ||
- `execute([config[, options]])` Function to execute the request manually, bypassing the cache by default. It optionally accepts the same `config` object as `axios`, which is _shallow-merged_ with the config object provided when invoking the hook. Useful to provide arguments to non-GET requests. It also optionally accepts an options object which has a `useCache` property, which allows caching to be enabled/disabled for this "execute" function. | ||
@@ -87,0 +87,0 @@ ### configure({ cache, axios }) |
31842
0.88%