I think all you have to do to cut the interceptor chain is to simply return an empty Observable
like so:
import { EMPTY } from 'rxjs';
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
if (stopThisRequest) {
return EMPTY;
}
return next.handle(request);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…