File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
- import axios from "axios" ;
1
+ import axios , { type AxiosStatic } from "axios" ;
2
2
import rateLimit , {
3
3
type RateLimitedAxiosInstance ,
4
4
type rateLimitOptions as RateLimitOptions ,
@@ -36,11 +36,17 @@ export default function createAxiosInstance(): RateLimitedAxiosInstance {
36
36
maxRPS : 2 ,
37
37
} ;
38
38
39
- const axiosClient = axios . create ( ) ;
39
+ // @FIXME : Legacy version of axios does not play well with verbatim types
40
+ const axiosClient = ( axios as unknown as AxiosStatic ) . create ( ) ;
40
41
41
42
axiosClient . defaults . headers . common [ "User-Agent" ] =
42
43
"React Native Version Tracker" ;
43
44
44
45
axiosRetry ( axiosClient , axiosRetryConfig ) ;
45
- return rateLimit ( axiosClient , axiosRateLimitOptions ) ;
46
+
47
+ // @FIXME : Legacy version of axios-rate-limit does not play well with verbatim types
48
+ return ( rateLimit as unknown as typeof import ( "axios-rate-limit" ) . default ) (
49
+ axiosClient ,
50
+ axiosRateLimitOptions
51
+ ) ;
46
52
}
You can’t perform that action at this time.
0 commit comments