Skip to content

Commit

Permalink
Remove unnecessary noop
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv committed Aug 30, 2018
1 parent 8f84cec commit 868ddcd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/ui/public/kfetch/kfetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,10 @@ function requestInterceptors(config: KFetchOptions): Promise<KFetchOptions> {
// Response hooks start from the oldest interceptor and end with the newest.
function responseInterceptors(responsePromise: Promise<any>) {
return interceptors.reduce((acc, interceptor) => {
return acc.then(interceptor.response || noop, interceptor.responseError);
return acc.then(interceptor.response, interceptor.responseError);
}, responsePromise);
}

const noop = (v: any) => v;

async function getBodyAsJson(res: Response) {
try {
return await res.json();
Expand Down

0 comments on commit 868ddcd

Please sign in to comment.