( chainTailFn: ChainedInterceptorFn<any>, interceptor: HttpInterceptor, )
| 151 | * `ChainedInterceptorFn` interface. |
| 152 | */ |
| 153 | export 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 |