axios-hooks
Advanced tools
Comparing version 1.8.0-0 to 1.8.0-1
@@ -5,2 +5,14 @@ # Changelog | ||
## [1.8.0-1](https://github.com/simoneb/axios-hooks/compare/v1.7.2...v1.8.0-1) (2019-12-06) | ||
### Features | ||
* support multiple instances of useAxios configured independently ([2b0e9a5](https://github.com/simoneb/axios-hooks/commit/2b0e9a58ed55d581f2b06244d68fa8d5609ed50d)), closes [#98](https://github.com/simoneb/axios-hooks/issues/98) | ||
### Bug Fixes | ||
* ts definitions for makeUseAxios ([bbdb3e0](https://github.com/simoneb/axios-hooks/commit/bbdb3e0085d55027151b74690d63657ac0c1118d)) | ||
## [1.8.0-0](https://github.com/simoneb/axios-hooks/compare/v1.7.2...v1.8.0-0) (2019-11-30) | ||
@@ -7,0 +19,0 @@ |
{ | ||
"name": "axios-hooks", | ||
"version": "1.8.0-0", | ||
"version": "1.8.0-1", | ||
"description": "axios-hooks", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -277,5 +277,5 @@ # axios-hooks | ||
Sometimes it is necessary to communicate with different APIs or use different caching strategies for different HTTP interactions. | ||
Sometimes it is necessary to communicate with different APIs or use different caching strategies for different HTTP interactions. | ||
[`makeUseAxios`](#makeuseaxios-cache-axios) allows to create multiple instances of the `useAxios` React Hook which can be configured and managed independently. | ||
[`makeUseAxios`](#makeuseaxios-cache-axios) allows to create multiple instances of the `useAxios` React Hook which can be configured and managed independently. | ||
@@ -295,9 +295,7 @@ In other words, `makeUseAxios` is a factory of `useAxios`, which returns a React Hook configured against the provided `axios` or `cache` instances. | ||
const useAxios = makeUseAxios({ | ||
axios: axios.create({ baseUrl: 'https://api.myjson.com '}) | ||
axios: axios.create({ baseURL: 'https://api.myjson.com' }) | ||
}) | ||
function App() { | ||
const [{ data, loading, error }, refetch] = useAxios( | ||
'/bins/820fc' | ||
) | ||
const [{ data, loading, error }, refetch] = useAxios('/bins/820fc') | ||
@@ -316,3 +314,2 @@ if (loading) return <p>Loading...</p> | ||
## Promises | ||
@@ -319,0 +316,0 @@ |
@@ -69,2 +69,2 @@ import { | ||
export function makeUseAxios<T>(options: ConfigureOptions): UseAxios<T> | ||
export function makeUseAxios(options: ConfigureOptions): UseAxios |
40115
327