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

Function adaptLegacyInterceptorToChain

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

Source from the content-addressed store, hash-verified

158 * `ChainedInterceptorFn` interface.
159 */
160export function adaptLegacyInterceptorToChain(
161 chainTailFn: ChainedInterceptorFn<any>,
162 interceptor: HttpInterceptor,
163): ChainedInterceptorFn<any> {
164 return (initialRequest, finalHandlerFn) =>
165 interceptor.intercept(initialRequest, {
166 handle: (downstreamRequest) => chainTailFn(downstreamRequest, finalHandlerFn),
167 });
168}
169
170/**
171 * 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