2
0
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:
Nick Uraltsev
2016-08-16 19:03:28 -07:00
parent 9a5e77bf6e
commit 48549c8de7
2 changed files with 16 additions and 2 deletions
+14
View File
@@ -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);