Skip to content

Commit 6161947

Browse files
refactor: use spread operator instead of '.apply()' (#6938)
Co-authored-by: Jay <[email protected]>
1 parent a1d16dd commit 6161947

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/core/Axios.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ class Axios {
153153

154154
if (!synchronousRequestInterceptors) {
155155
const chain = [dispatchRequest.bind(this), undefined];
156-
chain.unshift.apply(chain, requestInterceptorChain);
157-
chain.push.apply(chain, responseInterceptorChain);
156+
chain.unshift(...requestInterceptorChain);
157+
chain.push(...responseInterceptorChain);
158158
len = chain.length;
159159

160160
promise = Promise.resolve(config);

lib/helpers/throttle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function throttle(fn, freq) {
1717
clearTimeout(timer);
1818
timer = null;
1919
}
20-
fn.apply(null, args);
20+
fn(...args);
2121
}
2222

2323
const throttled = (...args) => {

0 commit comments

Comments
 (0)