MCPcopy Create free account
hub / github.com/angular/angular / adaptLegacyInterceptorToChain

Function adaptLegacyInterceptorToChain

packages/common/http/src/interceptor.ts:153–161  ·  view source on GitHub ↗
(
  chainTailFn: ChainedInterceptorFn<any>,
  interceptor: HttpInterceptor,
)

Source from the content-addressed store, hash-verified

151 * `ChainedInterceptorFn` interface.
152 */
153export function adaptLegacyInterceptorToChain(
154 chainTailFn: ChainedInterceptorFn<any>,
155 interceptor: HttpInterceptor,
156): ChainedInterceptorFn<any> {
157 return (initialRequest, finalHandlerFn) =>
158 interceptor.intercept(initialRequest, {
159 handle: (downstreamRequest) => chainTailFn(downstreamRequest, finalHandlerFn),
160 });
161}
162
163/**
164 * Constructs a `ChainedInterceptorFn` which wraps and invokes a functional interceptor in the given

Callers

nothing calls this directly

Calls 1

interceptMethod · 0.65

Tested by

no test coverage detected