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" ;
22import rateLimit , {
33 type RateLimitedAxiosInstance ,
44 type rateLimitOptions as RateLimitOptions ,
@@ -36,11 +36,17 @@ export default function createAxiosInstance(): RateLimitedAxiosInstance {
3636 maxRPS : 2 ,
3737 } ;
3838
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 ( ) ;
4041
4142 axiosClient . defaults . headers . common [ "User-Agent" ] =
4243 "React Native Version Tracker" ;
4344
4445 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+ ) ;
4652}
You can’t perform that action at this time.
0 commit comments