Skip to content

Commit

Permalink
feat: Allow using the cache when triggering requests manually
Browse files Browse the repository at this point in the history
Closes #19
  • Loading branch information
simoneb committed Jul 17, 2019
1 parent 7a4a89e commit 1fccd27
Show file tree
Hide file tree
Showing 6 changed files with 499 additions and 382 deletions.
8 changes: 0 additions & 8 deletions __mocks__/axios.js

This file was deleted.

15 changes: 11 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import { AxiosRequestConfig, AxiosError, AxiosPromise } from 'axios'

interface ResponseValues {
data: any;
loading: boolean;
error?: AxiosError;
data: any
loading: boolean
error?: AxiosError
}

interface Options {
manual: boolean
}

interface RefetchOptions {
useCache: boolean
}

export default function useAxios(
config: AxiosRequestConfig | string,
options?: Options
): [ResponseValues, (config?: AxiosRequestConfig) => void]
): [
ResponseValues,
(config?: AxiosRequestConfig, options?: RefetchOptions) => void
]
Loading

0 comments on commit 1fccd27

Please sign in to comment.