Skip to content

Commit f62677c

Browse files
committed
Extract bypass conditions in a single method
1 parent d764802 commit f62677c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/services/pending-interceptor.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,14 @@ export class PendingInterceptorService implements HttpInterceptor {
5959
});
6060
}
6161

62-
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
63-
const shouldBypass = this.shouldBypassUrl(req.urlWithParams)
62+
private shouldBypass(req: HttpRequest<any>) {
63+
return this.shouldBypassUrl(req.urlWithParams)
6464
|| this.shouldBypassMethod(req)
6565
|| this._forceByPass;
66+
}
67+
68+
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
69+
const shouldBypass = this.shouldBypass(req);
6670

6771
if (!shouldBypass) {
6872
this._pendingRequests++;

0 commit comments

Comments
 (0)