@univerjsnetworkfunctionsMergeinterceptorfactory

@univerjs/network v0.5.0-beta.1Docs


Function: MergeInterceptorFactory()

function MergeInterceptorFactory<T, C>(config, options): (requestConfig, next) => Observable<HTTPEvent<unknown>>

Type Parameters

Type Parameter
T
C

Parameters

ParameterTypeDescription
configobject-
config.getParamsFromRequest(requestConfig) => TPre-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) => booleanFilter requests that need to be merged
config.mergeParamsToRequest(list, requestConfig) => HTTPRequestThe request parameters are merged to initiate the request
optionsobject-
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

ParameterType
requestConfigHTTPRequest
nextHTTPHandlerFn

Returns

Observable<HTTPEvent<unknown>>

Defined in

submodules/univer/packages/network/src/services/http/interceptors/merge-interceptor.ts:46