From 868ddcdbe8c8a34e8176073ab6510359aade8abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Fri, 31 Aug 2018 01:17:22 +0200 Subject: [PATCH] Remove unnecessary noop --- src/ui/public/kfetch/kfetch.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ui/public/kfetch/kfetch.ts b/src/ui/public/kfetch/kfetch.ts index 6cf95627cf2fddf..f18db6da3e864fc 100644 --- a/src/ui/public/kfetch/kfetch.ts +++ b/src/ui/public/kfetch/kfetch.ts @@ -84,12 +84,10 @@ function requestInterceptors(config: KFetchOptions): Promise { // Response hooks start from the oldest interceptor and end with the newest. function responseInterceptors(responsePromise: Promise) { 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();