@univerjs/network v0.2.11 • Docs
Function: MergeInterceptorFactory()
function MergeInterceptorFactory<T, C>(config, options): (requestConfig, next) => Observable<HTTPEvent<unknown>>
Type Parameters
Type Parameter |
---|
T |
C |
Parameters
Parameter | Type | Description |
---|---|---|
config | object | - |
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 | object | - |
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
>>
Defined in
packages/network/src/services/http/interceptors/merge-interceptor.ts:46 (opens in a new tab)