Core
SSEInterceptorFn
SSE interceptor function: may inspect, modify, or replace the request, then call next.
@defjs/core · Type
Signature
type SSEInterceptorFn = ( req: HttpRequest, next: SSEHandler, ) => Promise<EventStreamHandle<unknown>>;
Call next (an SSEHandler) to continue the chain, or return your own
EventStreamHandle to short-circuit. Wrap it with createSSEInterceptor to
register it through withInterceptors.
A short-circuit handle must provide
[Symbol.asyncDispose](): PromiseLike<void> and connect it to the same close
lifecycle.
Parameters
Prop
Type
req HttpRequestnext SSEHandler