Skip to content

Commit

Permalink
update custom axios instance type
Browse files Browse the repository at this point in the history
  • Loading branch information
alijany committed Feb 14, 2024
1 parent 15973db commit 04a19f5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.5.0",
"version": "0.5.1",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/mutate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios, { AxiosRequestConfig } from 'axios';
import axios, { AxiosInstance, AxiosRequestConfig, AxiosStatic } from 'axios';
import { useCallback, useMemo, useRef, useState } from 'react';
import type { ZodType, ZodTypeDef } from 'zod';
import {
Expand Down Expand Up @@ -32,7 +32,7 @@ export function createMutateHook<
}: MutateOptions<Req> & {
defaultValidator?: ZodType<DefaultRes, ZodTypeDef>;
} = {},
axiosInstance = axios
axiosInstance: AxiosInstance | AxiosStatic = axios
) {
type Param = ExtractRouteParams<U>;

Expand Down
4 changes: 2 additions & 2 deletions src/query.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios from 'axios';
import axios, { AxiosInstance, AxiosStatic } from 'axios';
import { onSet } from 'nanostores';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import type { ZodType, ZodTypeDef } from 'zod';
Expand Down Expand Up @@ -34,7 +34,7 @@ export function createQueryHook<
}: CreateQueryHookOptions<Req> & {
defaultValidator?: ZodType<DefaultRes, ZodTypeDef>;
} = {},
axiosInstance = axios
axiosInstance: AxiosInstance | AxiosStatic = axios
) {
return function useQuery<
ValidatedRes,
Expand Down

0 comments on commit 04a19f5

Please sign in to comment.