mirror of
https://github.com/tenrok/axios.git
synced 2026-06-08 17:22:34 +03:00
Updating TypeScript definitions for axios.all and axios.spread
This commit is contained in:
@@ -203,3 +203,17 @@ const adapter: AxiosAdapter = (config: AxiosRequestConfig) => {
|
||||
};
|
||||
|
||||
axios.defaults.adapter = adapter;
|
||||
|
||||
// axios.all
|
||||
|
||||
const promises = [
|
||||
Promise.resolve(1),
|
||||
Promise.resolve(2)
|
||||
];
|
||||
|
||||
const promise: Promise<number[]> = axios.all(promises);
|
||||
|
||||
// axios.spread
|
||||
|
||||
const fn1 = (a: number, b: number, c: number) => `${a}-${b}-${c}`;
|
||||
const fn2: (arr: number[]) => string = axios.spread(fn1);
|
||||
|
||||
Reference in New Issue
Block a user