feat(request): add a response-interceptor seam
Add `extraResponseInterceptors` next to the existing request-interceptor seam and wire it into the request config, so build-time tooling can react to responses (e.g. clear a one-shot request-scoped hint after a write completes). Default is an empty list — no behavior change by default.
This commit is contained in:
@@ -13,3 +13,11 @@ export type RequestInterceptor = (
|
||||
) => { url: string; options: Record<string, any> };
|
||||
|
||||
export const extraRequestInterceptors: RequestInterceptor[] = [];
|
||||
|
||||
// Response-side counterpart. Each interceptor receives the (successful)
|
||||
// response and returns it; tooling may overwrite this file to react to
|
||||
// responses (e.g. clearing a one-shot request-scoped hint after a write
|
||||
// completes). Default is an empty list.
|
||||
export type ResponseInterceptor = (response: any) => any;
|
||||
|
||||
export const extraResponseInterceptors: ResponseInterceptor[] = [];
|
||||
|
||||
Reference in New Issue
Block a user