mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
refactor: use spread operator instead of '.apply()' (#6938)
Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
committed by
GitHub
parent
a1d16dd9c5
commit
6161947d9d
+2
-2
@@ -153,8 +153,8 @@ class Axios {
|
|||||||
|
|
||||||
if (!synchronousRequestInterceptors) {
|
if (!synchronousRequestInterceptors) {
|
||||||
const chain = [dispatchRequest.bind(this), undefined];
|
const chain = [dispatchRequest.bind(this), undefined];
|
||||||
chain.unshift.apply(chain, requestInterceptorChain);
|
chain.unshift(...requestInterceptorChain);
|
||||||
chain.push.apply(chain, responseInterceptorChain);
|
chain.push(...responseInterceptorChain);
|
||||||
len = chain.length;
|
len = chain.length;
|
||||||
|
|
||||||
promise = Promise.resolve(config);
|
promise = Promise.resolve(config);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function throttle(fn, freq) {
|
|||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
timer = null;
|
timer = null;
|
||||||
}
|
}
|
||||||
fn.apply(null, args);
|
fn(...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
const throttled = (...args) => {
|
const throttled = (...args) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user