Function: MergeInterceptorFactory()
function MergeInterceptorFactory<T, C>(config, options): (requestConfig, next) => Observable<HTTPEvent<unknown>>
Defined in: submodules/univer/packages/network/src/services/http/interceptors/merge-interceptor.ts:46
Type Parameters
Type Parameter |
---|
T |
C |
Parameters
Parameter | Type | Description |
---|---|---|
config | { getParamsFromRequest : (requestConfig ) => T ; isMatch : (requestConfig ) => boolean ; mergeParamsToRequest : (list , requestConfig ) => HTTPRequest ; } | - |
config.getParamsFromRequest | (requestConfig ) => T | Pre-process request parameters, the return value will be used as input parameters for subsequent operations The result is used as an index key |
config.isMatch | (requestConfig ) => boolean | Filter requests that need to be merged |
config.mergeParamsToRequest | (list , requestConfig ) => HTTPRequest | The request parameters are merged to initiate the request |
options | { distributeResult : (result , list ) => { config : T ; result : C ; }[]; fetchCheck : (currentConfig ) => Promise <boolean >; } | - |
options.distributeResult ? | (result , list ) => { config : T ; result : C ; }[] | The result of the request is dispatched based on the request parameters. By default each request gets the full result of the batch request |
options.fetchCheck ? | (currentConfig ) => Promise <boolean > | Determine when to initiate a request By default, requests up to 300ms are automatically aggregated |
Returns
Function
Parameters
Parameter | Type |
---|---|
requestConfig | HTTPRequest |
next | HTTPHandlerFn |
Returns
Observable
<HTTPEvent
<unknown
>>